[SCM] libav/experimental: add post 9 beta2 patches
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Mon Nov 12 18:33:48 UTC 2012
The following commit has been merged in the experimental branch:
commit c4741afd4222beda618f4c920396f7c32e48459d
Author: Reinhard Tartler <siretart at tauware.de>
Date: Sun Nov 11 17:21:01 2012 +0100
add post 9 beta2 patches
diff --git a/debian/patches/post-9beta2/0001-lzo-Use-AV_COPY-U-macros-where-appropriate.patch b/debian/patches/post-9beta2/0001-lzo-Use-AV_COPY-U-macros-where-appropriate.patch
new file mode 100644
index 0000000..a36e4cc
--- /dev/null
+++ b/debian/patches/post-9beta2/0001-lzo-Use-AV_COPY-U-macros-where-appropriate.patch
@@ -0,0 +1,76 @@
+From ceb754d041f5f6327fd9195a5f43575af9516daa Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Mon, 22 Oct 2012 19:02:20 +0200
+Subject: [PATCH 001/204] lzo: Use AV_COPY*U macros where appropriate
+
+---
+ libavutil/lzo.c | 28 ++++++++--------------------
+ 1 file changed, 8 insertions(+), 20 deletions(-)
+
+diff --git a/libavutil/lzo.c b/libavutil/lzo.c
+index 0d1ec55..101d4f4 100644
+--- a/libavutil/lzo.c
++++ b/libavutil/lzo.c
+@@ -23,6 +23,7 @@
+
+ #include "avutil.h"
+ #include "common.h"
++#include "intreadwrite.h"
+ #include "lzo.h"
+
+ /// Define if we may write up to 12 bytes beyond the output buffer.
+@@ -71,19 +72,6 @@ static inline int get_len(LZOContext *c, int x, int mask)
+ return cnt;
+ }
+
+-//#define UNALIGNED_LOADSTORE
+-#define BUILTIN_MEMCPY
+-#ifdef UNALIGNED_LOADSTORE
+-#define COPY2(d, s) *(uint16_t *)(d) = *(uint16_t *)(s);
+-#define COPY4(d, s) *(uint32_t *)(d) = *(uint32_t *)(s);
+-#elif defined(BUILTIN_MEMCPY)
+-#define COPY2(d, s) memcpy(d, s, 2);
+-#define COPY4(d, s) memcpy(d, s, 4);
+-#else
+-#define COPY2(d, s) (d)[0] = (s)[0]; (d)[1] = (s)[1];
+-#define COPY4(d, s) (d)[0] = (s)[0]; (d)[1] = (s)[1]; (d)[2] = (s)[2]; (d)[3] = (s)[3];
+-#endif
+-
+ /**
+ * @brief Copies bytes from input to output buffer with checking.
+ * @param cnt number of bytes to copy, must be >= 0
+@@ -101,7 +89,7 @@ static inline void copy(LZOContext *c, int cnt)
+ c->error |= AV_LZO_OUTPUT_FULL;
+ }
+ #if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)
+- COPY4(dst, src);
++ AV_COPY32U(dst, src);
+ src += 4;
+ dst += 4;
+ cnt -= 4;
+@@ -145,16 +133,16 @@ static inline void memcpy_backptr(uint8_t *dst, int back, int cnt)
+ memset(dst, *src, cnt);
+ } else {
+ #ifdef OUTBUF_PADDED
+- COPY2(dst, src);
+- COPY2(dst + 2, src + 2);
++ AV_COPY16U(dst, src);
++ AV_COPY16U(dst + 2, src + 2);
+ src += 4;
+ dst += 4;
+ cnt -= 4;
+ if (cnt > 0) {
+- COPY2(dst, src);
+- COPY2(dst + 2, src + 2);
+- COPY2(dst + 4, src + 4);
+- COPY2(dst + 6, src + 6);
++ AV_COPY16U(dst, src);
++ AV_COPY16U(dst + 2, src + 2);
++ AV_COPY16U(dst + 4, src + 4);
++ AV_COPY16U(dst + 6, src + 6);
+ src += 8;
+ dst += 8;
+ cnt -= 8;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0002-Remove-need-for-padding-in-av_memcpy_backptr.patch b/debian/patches/post-9beta2/0002-Remove-need-for-padding-in-av_memcpy_backptr.patch
new file mode 100644
index 0000000..bb4e532
--- /dev/null
+++ b/debian/patches/post-9beta2/0002-Remove-need-for-padding-in-av_memcpy_backptr.patch
@@ -0,0 +1,61 @@
+From d82f188504410fdfa446c5682c128c31bb5851a4 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Tue, 23 Oct 2012 18:05:45 +0100
+Subject: [PATCH 002/204] Remove need for padding in av_memcpy_backptr()
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavutil/lzo.c | 16 ++++++++--------
+ libavutil/lzo.h | 2 +-
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/libavutil/lzo.c b/libavutil/lzo.c
+index 101d4f4..c17d32f 100644
+--- a/libavutil/lzo.c
++++ b/libavutil/lzo.c
+@@ -132,13 +132,14 @@ static inline void memcpy_backptr(uint8_t *dst, int back, int cnt)
+ if (back == 1) {
+ memset(dst, *src, cnt);
+ } else {
+-#ifdef OUTBUF_PADDED
+- AV_COPY16U(dst, src);
+- AV_COPY16U(dst + 2, src + 2);
+- src += 4;
+- dst += 4;
+- cnt -= 4;
+- if (cnt > 0) {
++ if (cnt >= 4) {
++ AV_COPY16U(dst, src);
++ AV_COPY16U(dst + 2, src + 2);
++ src += 4;
++ dst += 4;
++ cnt -= 4;
++ }
++ if (cnt >= 8) {
+ AV_COPY16U(dst, src);
+ AV_COPY16U(dst + 2, src + 2);
+ AV_COPY16U(dst + 4, src + 4);
+@@ -147,7 +148,6 @@ static inline void memcpy_backptr(uint8_t *dst, int back, int cnt)
+ dst += 8;
+ cnt -= 8;
+ }
+-#endif
+ if (cnt > 0) {
+ int blocklen = back;
+ while (cnt > blocklen) {
+diff --git a/libavutil/lzo.h b/libavutil/lzo.h
+index e3c6c01..a84b9bd 100644
+--- a/libavutil/lzo.h
++++ b/libavutil/lzo.h
+@@ -61,7 +61,7 @@ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
+
+ /**
+ * @brief deliberately overlapping memcpy implementation
+- * @param dst destination buffer; must be padded with 12 additional bytes
++ * @param dst destination buffer
+ * @param back how many bytes back we start (the initial size of the overlapping window)
+ * @param cnt number of bytes to copy, must be >= 0
+ *
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0003-av_memcpy_backptr-Drop-no-longer-necessary-malloc-pa.patch b/debian/patches/post-9beta2/0003-av_memcpy_backptr-Drop-no-longer-necessary-malloc-pa.patch
new file mode 100644
index 0000000..5c7ccc6
--- /dev/null
+++ b/debian/patches/post-9beta2/0003-av_memcpy_backptr-Drop-no-longer-necessary-malloc-pa.patch
@@ -0,0 +1,57 @@
+From e831b3b852a23cd24f2941e68bd65299ce306880 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Tue, 23 Oct 2012 19:22:52 +0200
+Subject: [PATCH 003/204] av_memcpy_backptr: Drop no longer necessary malloc
+ padding
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavcodec/dfa.c | 2 +-
+ libavcodec/eatgv.c | 3 +--
+ libavcodec/lcldec.c | 3 ++-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
+index 39f0f64..46051e0 100644
+--- a/libavcodec/dfa.c
++++ b/libavcodec/dfa.c
+@@ -43,7 +43,7 @@ static av_cold int dfa_decode_init(AVCodecContext *avctx)
+ if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
+ return ret;
+
+- s->frame_buf = av_mallocz(avctx->width * avctx->height + AV_LZO_OUTPUT_PADDING);
++ s->frame_buf = av_mallocz(avctx->width * avctx->height);
+ if (!s->frame_buf)
+ return AVERROR(ENOMEM);
+
+diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
+index b29c994..404238b 100644
+--- a/libavcodec/eatgv.c
++++ b/libavcodec/eatgv.c
+@@ -294,8 +294,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
+ s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
+ s->frame.linesize[0] = s->width;
+
+- /* allocate additional 12 bytes to accommodate av_memcpy_backptr() OUTBUF_PADDED optimisation */
+- s->frame.data[0] = av_malloc(s->width*s->height + 12);
++ s->frame.data[0] = av_malloc(s->width * s->height);
+ if (!s->frame.data[0])
+ return AVERROR(ENOMEM);
+ s->frame.data[1] = av_malloc(AVPALETTE_SIZE);
+diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
+index 0de7410..6b101ae 100644
+--- a/libavcodec/lcldec.c
++++ b/libavcodec/lcldec.c
+@@ -476,7 +476,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
+ {
+ LclDecContext * const c = avctx->priv_data;
+ unsigned int basesize = avctx->width * avctx->height;
+- unsigned int max_basesize = FFALIGN(avctx->width, 4) * FFALIGN(avctx->height, 4) + AV_LZO_OUTPUT_PADDING;
++ unsigned int max_basesize = FFALIGN(avctx->width, 4) *
++ FFALIGN(avctx->height, 4);
+ unsigned int max_decomp_size;
+
+ if (avctx->extradata_size < 8) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0004-dfa-use-av_memcpy_backptr-where-previously-impossibl.patch b/debian/patches/post-9beta2/0004-dfa-use-av_memcpy_backptr-where-previously-impossibl.patch
new file mode 100644
index 0000000..87940c1
--- /dev/null
+++ b/debian/patches/post-9beta2/0004-dfa-use-av_memcpy_backptr-where-previously-impossibl.patch
@@ -0,0 +1,32 @@
+From a153e45b953dee5b065939300d3a591772f43b19 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Tue, 23 Oct 2012 18:17:46 +0100
+Subject: [PATCH 004/204] dfa: use av_memcpy_backptr() where previously
+ impossible
+
+Since the requirement for output padding has been lifted, we can
+use av_memcpy_backptr() here as well.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavcodec/dfa.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
+index 46051e0..ae184d7 100644
+--- a/libavcodec/dfa.c
++++ b/libavcodec/dfa.c
+@@ -122,9 +122,7 @@ static int decode_dsw1(GetByteContext *gb, uint8_t *frame, int width, int height
+ count = ((v >> 13) + 2) << 1;
+ if (frame - frame_start < offset || frame_end - frame < count)
+ return AVERROR_INVALIDDATA;
+- // can't use av_memcpy_backptr() since it can overwrite following pixels
+- for (v = 0; v < count; v++)
+- frame[v] = frame[v - offset];
++ av_memcpy_backptr(frame, offset, count);
+ frame += count;
+ } else if (bitbuf & (mask << 1)) {
+ frame += bytestream2_get_le16(gb);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0005-doxygen-Build-Doxygen-documentation-in-the-doc-subdi.patch b/debian/patches/post-9beta2/0005-doxygen-Build-Doxygen-documentation-in-the-doc-subdi.patch
new file mode 100644
index 0000000..50e9dd4
--- /dev/null
+++ b/debian/patches/post-9beta2/0005-doxygen-Build-Doxygen-documentation-in-the-doc-subdi.patch
@@ -0,0 +1,41 @@
+From d7a39b33407927005f65755b8a3a608394aaeccd Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Mon, 22 Oct 2012 16:01:18 +0200
+Subject: [PATCH 005/204] doxygen: Build Doxygen documentation in the doc/
+ subdirectory
+
+---
+ .gitignore | 2 +-
+ Doxyfile | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/.gitignore b/.gitignore
+index 8589127..3ed55b3 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -28,8 +28,8 @@
+ /doc/*.pod
+ /doc/avoptions_codec.texi
+ /doc/avoptions_format.texi
++/doc/doxy/html/
+ /doc/print_options
+-/doxy/
+ /libavcodec/*_tablegen
+ /libavcodec/*_tables.c
+ /libavcodec/*_tables.h
+diff --git a/Doxyfile b/Doxyfile
+index 8e0dcf3..1b4e7d5 100644
+--- a/Doxyfile
++++ b/Doxyfile
+@@ -44,7 +44,7 @@ PROJECT_LOGO =
+ # 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
++OUTPUT_DIRECTORY = doc/doxy
+
+ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+ # 4096 sub-directories (in 2 levels) under the output directory of each output
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0006-Move-Doxyfile-into-the-doc-subdirectory.patch b/debian/patches/post-9beta2/0006-Move-Doxyfile-into-the-doc-subdirectory.patch
new file mode 100644
index 0000000..aad81a2
--- /dev/null
+++ b/debian/patches/post-9beta2/0006-Move-Doxyfile-into-the-doc-subdirectory.patch
@@ -0,0 +1,3321 @@
+From 5e28e974339e90c2cee866bedbd913fe42917b15 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Mon, 22 Oct 2012 16:03:39 +0200
+Subject: [PATCH 006/204] Move Doxyfile into the doc/ subdirectory
+
+---
+ Doxyfile | 1647 ----------------------------------------------------------
+ doc/Doxyfile | 1647 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 1647 insertions(+), 1647 deletions(-)
+ delete mode 100644 Doxyfile
+ create mode 100644 doc/Doxyfile
+
+diff --git a/Doxyfile b/Doxyfile
+deleted file mode 100644
+index 1b4e7d5..0000000
+--- a/Doxyfile
++++ /dev/null
+@@ -1,1647 +0,0 @@
+-# Doxyfile 1.7.1
+-
+-# This file describes the settings to be used by the documentation system
+-# doxygen (www.doxygen.org) for a project
+-#
+-# All text after a hash (#) is considered a comment and will be ignored
+-# The format is:
+-# TAG = value [value, ...]
+-# For lists items can also be appended using:
+-# TAG += value [value, ...]
+-# Values that contain spaces should be placed between quotes (" ")
+-
+-#---------------------------------------------------------------------------
+-# Project related configuration options
+-#---------------------------------------------------------------------------
+-
+-# This tag specifies the encoding used for all characters in the config file
+-# that follow. The default is UTF-8 which is also the encoding used for all
+-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+-# iconv built into libc) for the transcoding. See
+-# http://www.gnu.org/software/libiconv for the list of possible encodings.
+-
+-DOXYFILE_ENCODING = UTF-8
+-
+-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+-# by quotes) that should identify the project.
+-
+-PROJECT_NAME = Libav
+-
+-# 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 =
+-
+-# With the PROJECT_LOGO tag one can specify an logo or icon that is included
+-# in the documentation. The maximum height of the logo should not exceed 55
+-# pixels and the maximum width should not exceed 200 pixels. Doxygen will
+-# copy the logo to the output directory.
+-PROJECT_LOGO =
+-
+-# 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 = doc/doxy
+-
+-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+-# 4096 sub-directories (in 2 levels) under the output directory of each output
+-# format and will distribute the generated files over these directories.
+-# Enabling this option can be useful when feeding doxygen a huge amount of
+-# source files, where putting all generated files in the same directory would
+-# otherwise cause performance problems for the file system.
+-
+-CREATE_SUBDIRS = NO
+-
+-# 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:
+-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+-
+-OUTPUT_LANGUAGE = English
+-
+-# 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
+-# brief descriptions will be completely suppressed.
+-
+-REPEAT_BRIEF = YES
+-
+-# This tag implements a quasi-intelligent brief description abbreviator
+-# that is used to form the text in various listings. Each string
+-# in this list, if found as the leading text of the brief description, will be
+-# stripped from the text and the result after processing the whole list, is
+-# used as the annotated text. Otherwise, the brief description is used as-is.
+-# If left blank, the following values are used ("$name" is automatically
+-# replaced with the name of the entity): "The $name class" "The $name widget"
+-# "The $name file" "is" "provides" "specifies" "contains"
+-# "represents" "a" "an" "the"
+-
+-ABBREVIATE_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 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
+-# 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
+-# the path. The tag can be used to show relative paths in the file list.
+-# If left blank the directory from which doxygen is run is used as the
+-# path to strip.
+-
+-STRIP_FROM_PATH = .
+-
+-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+-# the path mentioned in the documentation of a class, which tells
+-# the reader which header file to include in order to use a class.
+-# If left blank only the name of the header file containing the class
+-# definition is used. Otherwise one should specify the include paths that
+-# are normally passed to the compiler using the -I flag.
+-
+-STRIP_FROM_INC_PATH =
+-
+-# 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 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 regular Qt-style comments
+-# (thus requiring an explicit @brief command for a brief description.)
+-
+-JAVADOC_AUTOBRIEF = YES
+-
+-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+-# interpret the first line (until the first dot) of a Qt-style
+-# comment as the brief description. If set to NO, the comments
+-# will behave just like regular Qt-style comments (thus requiring
+-# an explicit \brief command for a brief description.)
+-
+-QT_AUTOBRIEF = NO
+-
+-# 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 INHERIT_DOCS tag is set to YES (the default) then an undocumented
+-# member inherits the documentation from any documented member that it
+-# re-implements.
+-
+-INHERIT_DOCS = YES
+-
+-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+-# a new page for each member. If set to NO, the documentation of a member will
+-# be part of the file/class/namespace that contains it.
+-
+-SEPARATE_MEMBER_PAGES = NO
+-
+-# 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
+-
+-# 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 =
+-
+-# 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 will look different, etc.
+-
+-OPTIMIZE_OUTPUT_JAVA = NO
+-
+-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+-# sources only. Doxygen will then generate output that is more tailored for
+-# Fortran.
+-
+-OPTIMIZE_FOR_FORTRAN = NO
+-
+-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+-# sources. Doxygen will then generate output that is tailored for
+-# VHDL.
+-
+-OPTIMIZE_OUTPUT_VHDL = NO
+-
+-# Doxygen selects the parser to use depending on the extension of the files it
+-# parses. With this tag you can assign which parser to use for a given extension.
+-# Doxygen has a built-in mapping, but you can override or extend it using this
+-# tag. The format is ext=language, where ext is a file extension, and language
+-# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+-# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+-
+-EXTENSION_MAPPING =
+-
+-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+-# to include (a tag file for) the STL sources as input, then you should
+-# set this tag to YES in order to let doxygen match functions declarations and
+-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+-# func(std::string) {}). This also make the inheritance and collaboration
+-# diagrams that involve STL classes more complete and accurate.
+-
+-BUILTIN_STL_SUPPORT = NO
+-
+-# If you use Microsoft's C++/CLI language, you should set this option to YES to
+-# enable parsing support.
+-
+-CPP_CLI_SUPPORT = NO
+-
+-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+-# Doxygen will parse them like normal C++ but will assume all classes use public
+-# instead of private inheritance when no explicit protection keyword is present.
+-
+-SIP_SUPPORT = NO
+-
+-# For Microsoft's IDL there are propget and propput attributes to indicate getter
+-# and setter methods for a property. Setting this option to YES (the default)
+-# will make doxygen to replace the get and set methods by a property in the
+-# documentation. This will only work if the methods are indeed getting or
+-# setting a simple type. If this is not the case, or you want to show the
+-# methods anyway, you should set this option to NO.
+-
+-IDL_PROPERTY_SUPPORT = 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
+-# all members of a group must be documented explicitly.
+-
+-DISTRIBUTE_GROUP_DOC = NO
+-
+-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+-# the same type (for instance a group of public functions) to be put as a
+-# subgroup of that type (e.g. under the Public Functions section). Set it to
+-# NO to prevent subgrouping. Alternatively, this can be done per class using
+-# the \nosubgrouping command.
+-
+-SUBGROUPING = YES
+-
+-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+-# is documented as struct, union, or enum with the name of the typedef. So
+-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+-# with name TypeT. When disabled the typedef will appear as a member of a file,
+-# namespace, or class. And the struct will be named TypeS. This can typically
+-# be useful for C code in case the coding convention dictates that all compound
+-# types are typedef'ed and only the typedef is referenced, never the tag name.
+-
+-TYPEDEF_HIDES_STRUCT = NO
+-
+-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+-# determine which symbols to keep in memory and which to flush to disk.
+-# When the cache is full, less often used symbols will be written to disk.
+-# For small to medium size projects (<1000 input files) the default value is
+-# probably good enough. For larger projects a too small cache size can cause
+-# doxygen to be busy swapping symbols to and from disk most of the time
+-# causing a significant performance penality.
+-# If the system has enough physical memory increasing the cache will improve the
+-# performance by keeping more symbols in memory. Note that the value works on
+-# a logarithmic scale so increasing the size by one will rougly double the
+-# memory usage. The cache size is given by this formula:
+-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+-# corresponding to a cache size of 2^16 = 65536 symbols
+-
+-SYMBOL_CACHE_SIZE = 0
+-
+-#---------------------------------------------------------------------------
+-# Build related configuration options
+-#---------------------------------------------------------------------------
+-
+-# 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
+-# will be included in the documentation.
+-
+-EXTRACT_PRIVATE = YES
+-
+-# 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 set to NO only classes defined in header files are included.
+-
+-EXTRACT_LOCAL_CLASSES = YES
+-
+-# This flag is only useful for Objective-C code. When set to YES local
+-# methods, which are defined in the implementation section but not in
+-# the interface are included in the documentation.
+-# If set to NO (the default) only methods in the interface are included.
+-
+-EXTRACT_LOCAL_METHODS = NO
+-
+-# If this flag is set to YES, the members of anonymous namespaces will be
+-# extracted and appear in the documentation as a namespace called
+-# 'anonymous_namespace{file}', where file will be replaced with the base
+-# name of the file that contains the anonymous namespace. By default
+-# anonymous namespace are hidden.
+-
+-EXTRACT_ANON_NSPACES = NO
+-
+-# 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 classes 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
+-# 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
+-# function's detailed documentation block.
+-
+-HIDE_IN_BODY_DOCS = NO
+-
+-# 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
+-# and Mac users are advised to set this option to NO.
+-
+-CASE_SENSE_NAMES = YES
+-
+-# 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 SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+-# will put a list of the files that are included by a file in the documentation
+-# of that file.
+-
+-SHOW_INCLUDE_FILES = YES
+-
+-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+-# will list include files with double quotes in the documentation
+-# rather than with sharp brackets.
+-
+-FORCE_LOCAL_INCLUDES = NO
+-
+-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+-# is inserted in the documentation for inline members.
+-
+-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
+-# declaration order.
+-
+-SORT_MEMBER_DOCS = YES
+-
+-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+-# brief documentation of file, namespace and class members alphabetically
+-# by member name. If set to NO (the default) the members will appear in
+-# declaration order.
+-
+-SORT_BRIEF_DOCS = NO
+-
+-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+-# will sort the (brief and detailed) documentation of class members so that
+-# constructors and destructors are listed first. If set to NO (the default)
+-# the constructors will appear in the respective orders defined by
+-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+-
+-SORT_MEMBERS_CTORS_1ST = NO
+-
+-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+-# hierarchy of group names into alphabetical order. If set to NO (the default)
+-# the group names will appear in their defined order.
+-
+-SORT_GROUP_NAMES = NO
+-
+-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+-# sorted by fully-qualified names, including namespaces. If set to
+-# NO (the default), the class list will be sorted only by class name,
+-# not including the namespace part.
+-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+-# Note: This option applies only to the class list, not to the
+-# alphabetical list.
+-
+-SORT_BY_SCOPE_NAME = NO
+-
+-# 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
+-# 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
+-# 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
+-# \deprecated commands in the documentation.
+-
+-GENERATE_DEPRECATEDLIST= YES
+-
+-# The ENABLED_SECTIONS tag can be used to enable conditional
+-# documentation sections, marked by \if sectionname ... \endif.
+-
+-ENABLED_SECTIONS =
+-
+-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+-# the initial value of a variable or define consists 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 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
+-
+-# If the sources in your project are distributed over multiple directories
+-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+-# in the documentation. The default is NO.
+-
+-SHOW_DIRECTORIES = NO
+-
+-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+-# This will remove the Files entry from the Quick Index and from the
+-# Folder Tree View (if specified). The default is YES.
+-
+-SHOW_FILES = YES
+-
+-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+-# Namespaces page.
+-# This will remove the Namespaces entry from the Quick Index
+-# and from the Folder Tree View (if specified). The default is YES.
+-
+-SHOW_NAMESPACES = YES
+-
+-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+-# doxygen should invoke to get the current version for each file (typically from
+-# the version control system). Doxygen will invoke the program by executing (via
+-# popen()) the command <command> <input-file>, where <command> is the value of
+-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+-# provided by doxygen. Whatever the program writes to standard output
+-# is used as the file version. See the manual for examples.
+-
+-FILE_VERSION_FILTER =
+-
+-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+-# by doxygen. The layout file controls the global structure of the generated
+-# output files in an output format independent way. The create the layout file
+-# that represents doxygen's defaults, run doxygen with the -l option.
+-# You can optionally specify a file name after the option, if omitted
+-# DoxygenLayout.xml will be used as the name of the layout file.
+-
+-LAYOUT_FILE =
+-
+-#---------------------------------------------------------------------------
+-# configuration options related to warning and progress messages
+-#---------------------------------------------------------------------------
+-
+-# 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 = YES
+-
+-# 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
+-# automatically be disabled.
+-
+-WARN_IF_UNDOCUMENTED = YES
+-
+-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+-# potential errors in the documentation, such as not documenting some
+-# parameters in a documented function, or documenting parameters that
+-# don't exist or using markup commands wrongly.
+-
+-WARN_IF_DOC_ERROR = YES
+-
+-# This WARN_NO_PARAMDOC option can be abled to get warnings for
+-# functions that are documented, but have no documentation for their parameters
+-# or return value. If set to NO (the default) doxygen will only warn about
+-# wrong or incomplete parameter documentation, but not about the absence of
+-# documentation.
+-
+-WARN_NO_PARAMDOC = NO
+-
+-# 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. Optionally the format may contain
+-# $version, which will be replaced by the version of the file (if it could
+-# be obtained via FILE_VERSION_FILTER)
+-
+-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
+-# to stderr.
+-
+-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
+-# with spaces.
+-
+-INPUT =
+-
+-# This tag can be used to specify the character encoding of the source files
+-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+-# also the default input encoding. Doxygen uses libiconv (or the iconv built
+-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+-# the list of possible encodings.
+-
+-INPUT_ENCODING = UTF-8
+-
+-# 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 *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+-
+-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.
+-# 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
+-# subdirectory from a directory tree whose root is specified with the INPUT tag.
+-
+-EXCLUDE =
+-
+-# 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
+-# certain files from those directories. Note that the wildcards are matched
+-# against the file with absolute path, so to exclude all test directories
+-# for example use the pattern */test/*
+-
+-EXCLUDE_PATTERNS = *.git \
+- *.d
+-
+-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+-# (namespaces, classes, functions, etc.) that should be excluded from the
+-# output. The symbol name can be a fully qualified name, a word, or if the
+-# wildcard * is used, a substring. Examples: ANamespace, AClass,
+-# AClass::ANamespace, ANamespace::*Test
+-
+-EXCLUDE_SYMBOLS =
+-
+-# 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 = libavcodec/ \
+- libavformat/
+-
+-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+-# and *.h) to filter out the source-files in the directories. If left
+-# blank all files are included.
+-
+-EXAMPLE_PATTERNS = *-example.c
+-
+-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+-# searched for input files to be used with the \include or \dontinclude
+-# 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 command).
+-
+-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
+-# to standard output.
+-# If FILTER_PATTERNS is specified, this tag will be
+-# ignored.
+-
+-INPUT_FILTER =
+-
+-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+-# basis.
+-# Doxygen will compare the file name with each pattern and apply the
+-# filter if there is a match.
+-# The filters are a list of the form:
+-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+-# is applied to all files.
+-
+-FILTER_PATTERNS =
+-
+-# 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
+-# be generated. Documented entities will be cross-referenced with these sources.
+-# Note: To get rid of all source code in the generated output, make sure also
+-# VERBATIM_HEADERS is set to NO.
+-
+-SOURCE_BROWSER = YES
+-
+-# 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
+-# fragments. Normal C and C++ comments will always remain visible.
+-
+-STRIP_CODE_COMMENTS = YES
+-
+-# If the REFERENCED_BY_RELATION tag is set to YES
+-# 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
+-# then for each documented function all documented entities
+-# called/used by that function will be listed.
+-
+-REFERENCES_RELATION = NO
+-
+-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+-# link to the source code.
+-# Otherwise they will link to the documentation.
+-
+-REFERENCES_LINK_SOURCE = YES
+-
+-# If the USE_HTAGS tag is set to YES then the references to source code
+-# will point to the HTML generated by the htags(1) tool instead of doxygen
+-# built-in source browser. The htags tool is part of GNU's global source
+-# tagging system (see http://www.gnu.org/software/global/global.html). You
+-# will need version 4.8.6 or higher.
+-
+-USE_HTAGS = 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
+-# which an include is specified. Set to NO to disable this.
+-
+-VERBATIM_HEADERS = YES
+-
+-#---------------------------------------------------------------------------
+-# 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
+-# 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
+-# in which this list will be split (can be a number in the range [1..20])
+-
+-COLS_IN_ALPHA_INDEX = 2
+-
+-# 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 =
+-
+-#---------------------------------------------------------------------------
+-# configuration options related to the HTML output
+-#---------------------------------------------------------------------------
+-
+-# 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
+-# 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
+-# 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
+-# standard header.
+-
+-HTML_HEADER = doc/doxy/header.html
+-
+-# 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 = doc/doxy/footer.html
+-
+-# 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. Note that doxygen will try to copy
+-# the style sheet file to the HTML output directory, so don't put your own
+-# stylesheet in the HTML output directory as well, or it will be erased!
+-
+-HTML_STYLESHEET = doc/doxy/doxy_stylesheet.css
+-
+-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+-# Doxygen will adjust the colors in the stylesheet and background images
+-# according to this color. Hue is specified as an angle on a colorwheel,
+-# see http://en.wikipedia.org/wiki/Hue for more information.
+-# For instance the value 0 represents red, 60 is yellow, 120 is green,
+-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+-# The allowed range is 0 to 359.
+-
+-HTML_COLORSTYLE_HUE = 120
+-
+-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+-# the colors in the HTML output. For a value of 0 the output will use
+-# grayscales only. A value of 255 will produce the most vivid colors.
+-
+-HTML_COLORSTYLE_SAT = 100
+-
+-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+-# the luminance component of the colors in the HTML output. Values below
+-# 100 gradually make the output lighter, whereas values above 100 make
+-# the output darker. The value divided by 100 is the actual gamma applied,
+-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+-# and 100 does not change the gamma.
+-
+-HTML_COLORSTYLE_GAMMA = 80
+-
+-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+-# page will contain the date and time when the page was generated. Setting
+-# this to NO can help when comparing the output of multiple runs.
+-
+-HTML_TIMESTAMP = YES
+-
+-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+-# files or namespaces will be aligned in HTML using tables. If set to
+-# NO a bullet list will be used.
+-
+-HTML_ALIGN_MEMBERS = YES
+-
+-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+-# documentation will contain sections that can be hidden and shown after the
+-# page has loaded. For this to work a browser that supports
+-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+-
+-HTML_DYNAMIC_SECTIONS = NO
+-
+-# If the GENERATE_DOCSET tag is set to YES, additional index files
+-# will be generated that can be used as input for Apple's Xcode 3
+-# integrated development environment, introduced with OS X 10.5 (Leopard).
+-# To create a documentation set, doxygen will generate a Makefile in the
+-# HTML output directory. Running make will produce the docset in that
+-# directory and running "make install" will install the docset in
+-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+-# it at startup.
+-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+-# for more information.
+-
+-GENERATE_DOCSET = NO
+-
+-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+-# feed. A documentation feed provides an umbrella under which multiple
+-# documentation sets from a single provider (such as a company or product suite)
+-# can be grouped.
+-
+-DOCSET_FEEDNAME = "Doxygen generated docs"
+-
+-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+-# should uniquely identify the documentation set bundle. This should be a
+-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+-# will append .docset to the name.
+-
+-DOCSET_BUNDLE_ID = org.doxygen.Project
+-
+-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+-# the documentation publisher. This should be a reverse domain-name style
+-# string, e.g. com.mycompany.MyDocSet.documentation.
+-
+-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+-
+-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+-
+-DOCSET_PUBLISHER_NAME = Publisher
+-
+-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+-# will be generated that can be used as input for tools like the
+-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+-# of the generated HTML documentation.
+-
+-GENERATE_HTMLHELP = NO
+-
+-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+-# be used to specify the file name of the resulting .chm file. You
+-# can add a path in front of the file if the result should not be
+-# written to the html output directory.
+-
+-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
+-# the HTML help compiler on the generated index.hhp.
+-
+-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
+-# it should be included in the master .chm file (NO).
+-
+-GENERATE_CHI = NO
+-
+-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+-# content.
+-
+-CHM_INDEX_ENCODING =
+-
+-# 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
+-# to the contents of the HTML help documentation and to the tree view.
+-
+-TOC_EXPAND = NO
+-
+-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+-# that can be used as input for Qt's qhelpgenerator to generate a
+-# Qt Compressed Help (.qch) of the generated HTML documentation.
+-
+-GENERATE_QHP = NO
+-
+-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+-# be used to specify the file name of the resulting .qch file.
+-# The path specified is relative to the HTML output folder.
+-
+-QCH_FILE =
+-
+-# The QHP_NAMESPACE tag specifies the namespace to use when generating
+-# Qt Help Project output. For more information please see
+-# http://doc.trolltech.com/qthelpproject.html#namespace
+-
+-QHP_NAMESPACE = org.doxygen.Project
+-
+-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+-# Qt Help Project output. For more information please see
+-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+-
+-QHP_VIRTUAL_FOLDER = doc
+-
+-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+-# add. For more information please see
+-# http://doc.trolltech.com/qthelpproject.html#custom-filters
+-
+-QHP_CUST_FILTER_NAME =
+-
+-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+-# custom filter to add. For more information please see
+-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+-# Qt Help Project / Custom Filters</a>.
+-
+-QHP_CUST_FILTER_ATTRS =
+-
+-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+-# project's
+-# filter section matches.
+-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+-# Qt Help Project / Filter Attributes</a>.
+-
+-QHP_SECT_FILTER_ATTRS =
+-
+-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+-# be used to specify the location of Qt's qhelpgenerator.
+-# If non-empty doxygen will try to run qhelpgenerator on the generated
+-# .qhp file.
+-
+-QHG_LOCATION =
+-
+-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+-# will be generated, which together with the HTML files, form an Eclipse help
+-# plugin. To install this plugin and make it available under the help contents
+-# menu in Eclipse, the contents of the directory containing the HTML and XML
+-# files needs to be copied into the plugins directory of eclipse. The name of
+-# the directory within the plugins directory should be the same as
+-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+-# the help appears.
+-
+-GENERATE_ECLIPSEHELP = NO
+-
+-# A unique identifier for the eclipse help plugin. When installing the plugin
+-# the directory name containing the HTML and XML files should also have
+-# this name.
+-
+-ECLIPSE_DOC_ID = org.doxygen.Project
+-
+-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+-# top of each HTML page. The value NO (the default) enables the index and
+-# the value YES disables it.
+-
+-DISABLE_INDEX = NO
+-
+-# 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
+-
+-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+-# structure should be generated to display hierarchical information.
+-# If the tag value is set to YES, a side panel will be generated
+-# containing a tree-like index structure (just like the one that
+-# is generated for HTML Help). For this to work a browser that supports
+-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+-# Windows users are probably better off using the HTML help feature.
+-
+-GENERATE_TREEVIEW = NO
+-
+-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+-# and Class Hierarchy pages using a tree view instead of an ordered list.
+-
+-USE_INLINE_TREES = NO
+-
+-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+-# used to set the initial width (in pixels) of the frame in which the tree
+-# is shown.
+-
+-TREEVIEW_WIDTH = 250
+-
+-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+-# links to external symbols imported via tag files in a separate window.
+-
+-EXT_LINKS_IN_WINDOW = NO
+-
+-# Use this tag to change the font size of Latex formulas included
+-# as images in the HTML documentation. The default is 10. Note that
+-# when you change the font size after a successful doxygen run you need
+-# to manually remove any form_*.png images from the HTML output directory
+-# to force them to be regenerated.
+-
+-FORMULA_FONTSIZE = 10
+-
+-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+-# generated for formulas are transparent PNGs. Transparent PNGs are
+-# not supported properly for IE 6.0, but are supported on all modern browsers.
+-# Note that when changing this option you need to delete any form_*.png files
+-# in the HTML output before the changes have effect.
+-
+-FORMULA_TRANSPARENT = YES
+-
+-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+-# for the HTML output. The underlying search engine uses javascript
+-# and DHTML and should work on any modern browser. Note that when using
+-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+-# (GENERATE_DOCSET) there is already a search function so this one should
+-# typically be disabled. For large projects the javascript based search engine
+-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+-
+-SEARCHENGINE = NO
+-
+-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+-# implemented using a PHP enabled web server instead of at the web client
+-# using Javascript. Doxygen will generate the search PHP script and index
+-# file to put on the web server. The advantage of the server
+-# based approach is that it scales better to large projects and allows
+-# full text search. The disadvances is that it is more difficult to setup
+-# and does not have live searching capabilities.
+-
+-SERVER_BASED_SEARCH = NO
+-
+-#---------------------------------------------------------------------------
+-# configuration options related to the LaTeX output
+-#---------------------------------------------------------------------------
+-
+-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+-# generate Latex output.
+-
+-GENERATE_LATEX = NO
+-
+-# 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
+-# invoked. If left blank `latex' will be used as the default command name.
+-# Note that when enabling USE_PDFLATEX this option is only used for
+-# generating bitmaps for formulas in the HTML output, but not in the
+-# Makefile that is written to the output directory.
+-
+-LATEX_CMD_NAME = latex
+-
+-# 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
+-# 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
+-# 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
+-# packages that should be included in the LaTeX output.
+-
+-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
+-# standard header. Notice: only use this tag if you know what you are doing!
+-
+-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
+-# 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
+-# 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.
+-# This option is also used when generating formulas in HTML.
+-
+-LATEX_BATCHMODE = NO
+-
+-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+-# include the index chapters (such as File Index, Compound Index, etc.)
+-# in the output.
+-
+-LATEX_HIDE_INDICES = NO
+-
+-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+-# source code with syntax highlighting in the LaTeX output.
+-# Note that which sources are shown also depends on other settings
+-# such as SOURCE_BROWSER.
+-
+-LATEX_SOURCE_CODE = NO
+-
+-#---------------------------------------------------------------------------
+-# configuration options related to the RTF output
+-#---------------------------------------------------------------------------
+-
+-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+-# The RTF output is optimized 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
+-# 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
+-# 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.
+-# 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 assignments. You only have to provide
+-# replacements, missing definitions are set to their default value.
+-
+-RTF_STYLESHEET_FILE =
+-
+-# Set optional variables used in the generation of an rtf document.
+-# Syntax is similar to doxygen's config 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
+-# 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
+-# 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 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
+-# 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.
+-
+-GENERATE_XML = NO
+-
+-# The XML_OUTPUT tag is used to specify where the XML 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 `xml' will be used as the default path.
+-
+-XML_OUTPUT = xml
+-
+-# 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 =
+-
+-# 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 =
+-
+-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+-# dump the program listings (including syntax highlighting
+-# and cross-referencing information) to the XML output. Note that
+-# enabling this will significantly increase the size of the XML output.
+-
+-XML_PROGRAMLISTING = YES
+-
+-#---------------------------------------------------------------------------
+-# 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
+-# 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
+-# 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
+-# 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
+-# 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
+-# Makefile don't overwrite each other's variables.
+-
+-PERLMOD_MAKEVAR_PREFIX =
+-
+-#---------------------------------------------------------------------------
+-# 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
+-# 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
+-# 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
+-# PREDEFINED and EXPAND_AS_DEFINED tags.
+-
+-EXPAND_ONLY_PREDEF = YES
+-
+-# 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 preprocessor.
+-
+-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
+-# be used.
+-
+-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
+-# omitted =1 is assumed. To prevent a macro definition from being
+-# undefined via #undef or recursively expanded use the := operator
+-# instead of the = operator.
+-
+-PREDEFINED = "__attribute__(x)=" \
+- "RENAME(x)=x ## _TMPL" \
+- "DEF(x)=x ## _TMPL" \
+- HAVE_AV_CONFIG_H \
+- HAVE_MMX \
+- HAVE_MMXEXT \
+- HAVE_AMD3DNOW \
+- "DECLARE_ALIGNED(a,t,n)=t n" \
+- "offsetof(x,y)=0x42"
+-
+-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+-# this tag can be used to specify a list of macro names that should be expanded.
+-# The macro definition that is found in the sources will be used.
+-# Use the PREDEFINED tag if you want to use a different macro definition.
+-
+-EXPAND_AS_DEFINED = declare_idct \
+- READ_PAR_DATA \
+-
+-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+-# doxygen's preprocessor will remove all function-like macros that are alone
+-# 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::additions related to external references
+-#---------------------------------------------------------------------------
+-
+-# The TAGFILES option can be used to specify one or more tagfiles.
+-# Optionally an initial location of the external documentation
+-# can be added for each tagfile. The format of a tag file without
+-# this location is as follows:
+-#
+-# TAGFILES = file1 file2 ...
+-# Adding location for the tag files is done as follows:
+-#
+-# TAGFILES = file1=loc1 "file2 = loc2" ...
+-# where "loc1" and "loc2" can be relative or absolute paths or
+-# URLs. If a location is present for each tag, the installdox tool
+-# does not have to be run to correct the links.
+-# Note that each tag file must have a unique name
+-# (where the name does NOT include the path)
+-# If a tag file is not located in the directory in which doxygen
+-# is run, you must also specify the path to the tagfile here.
+-
+-TAGFILES =
+-
+-# 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 =
+-
+-# 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
+-# be listed.
+-
+-EXTERNAL_GROUPS = YES
+-
+-# 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
+-#---------------------------------------------------------------------------
+-
+-# 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 superseded by the HAVE_DOT option below. This is only a
+-# fallback. It is recommended to install and use dot, since it yields more
+-# powerful graphs.
+-
+-CLASS_DIAGRAMS = YES
+-
+-# You can define message sequence charts within doxygen comments using the \msc
+-# command. Doxygen will then run the mscgen tool (see
+-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+-# the mscgen tool resides. If left empty the tool is assumed to be found in the
+-# default search path.
+-
+-MSCGEN_PATH =
+-
+-# 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
+-# have no effect if this option is set to NO (the default)
+-
+-HAVE_DOT = NO
+-
+-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+-# allowed to run in parallel. When set to 0 (the default) doxygen will
+-# base this on the number of processors available in the system. You can set it
+-# explicitly to a value larger than 0 to get control over the balance
+-# between CPU load and processing speed.
+-
+-DOT_NUM_THREADS = 0
+-
+-# By default doxygen will write a font called FreeSans.ttf to the output
+-# directory and reference it in all dot files that doxygen generates. This
+-# font does not include all possible unicode characters however, so when you need
+-# these (or just want a differently looking font) you can specify the font name
+-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+-# which can be done by putting it in a standard location or by setting the
+-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+-# containing the font.
+-
+-DOT_FONTNAME = FreeSans
+-
+-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+-# The default size is 10pt.
+-
+-DOT_FONTSIZE = 10
+-
+-# By default doxygen will tell dot to use the output directory to look for the
+-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+-# different font using DOT_FONTNAME you can set the path where dot
+-# can find it using this tag.
+-
+-DOT_FONTPATH =
+-
+-# 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
+-# class references variables) of the class with other documented classes.
+-
+-COLLABORATION_GRAPH = YES
+-
+-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+-# will generate a graph for groups, showing the direct groups dependencies
+-
+-GROUP_GRAPHS = YES
+-
+-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+-# collaboration diagrams in a style similar to the OMG's Unified Modeling
+-# Language.
+-
+-UML_LOOK = NO
+-
+-# 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
+-# 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
+-# indirectly include this file.
+-
+-INCLUDED_BY_GRAPH = YES
+-
+-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+-# doxygen will generate a call dependency graph for every global function
+-# or class method. Note that enabling this option will significantly increase
+-# the time of a run. So in most cases it will be better to enable call graphs
+-# for selected functions only using the \callgraph command.
+-
+-CALL_GRAPH = NO
+-
+-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+-# doxygen will generate a caller dependency graph for every global function
+-# or class method. Note that enabling this option will significantly increase
+-# the time of a run. So in most cases it will be better to enable caller
+-# graphs for selected functions only using the \callergraph command.
+-
+-CALLER_GRAPH = NO
+-
+-# 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
+-
+-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+-# then doxygen will show the dependencies a directory has on other directories
+-# in a graphical way. The dependency relations are determined by the #include
+-# relations between the files in the directories.
+-
+-DIRECTORY_GRAPH = YES
+-
+-# 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
+-# found. If left blank, it is assumed the dot tool can be found in the 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
+-# \dotfile command).
+-
+-DOTFILE_DIRS =
+-
+-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+-# nodes that will be shown in the graph. If the number of nodes in a graph
+-# becomes larger than this value, doxygen will truncate the graph, which is
+-# visualized by representing a node as a red box. Note that doxygen if the
+-# number of direct children of the root node in a graph is already larger than
+-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+-
+-DOT_GRAPH_MAX_NODES = 50
+-
+-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+-# graphs generated by dot. A depth value of 3 means that only nodes reachable
+-# from the root by following a path via at most 3 edges will be shown. Nodes
+-# that lay further from the root node will be omitted. Note that setting this
+-# option to 1 or 2 may greatly reduce the computation time needed for large
+-# code bases. Also note that the size of a graph can be further restricted by
+-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+-
+-MAX_DOT_GRAPH_DEPTH = 0
+-
+-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+-# background. This is disabled by default, because dot on Windows does not
+-# seem to support this out of the box. Warning: Depending on the platform used,
+-# enabling this option may lead to badly anti-aliased labels on the edges of
+-# a graph (i.e. they become hard to read).
+-
+-DOT_TRANSPARENT = YES
+-
+-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+-# files in one run (i.e. multiple -o and -T options on the command line). This
+-# makes dot run faster, but since only newer versions of dot (>1.8.10)
+-# support this, this feature is disabled by default.
+-
+-DOT_MULTI_TARGETS = NO
+-
+-# 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 intermediate dot files that are used to generate
+-# the various graphs.
+-
+-DOT_CLEANUP = YES
+diff --git a/doc/Doxyfile b/doc/Doxyfile
+new file mode 100644
+index 0000000..1b4e7d5
+--- /dev/null
++++ b/doc/Doxyfile
+@@ -0,0 +1,1647 @@
++# Doxyfile 1.7.1
++
++# This file describes the settings to be used by the documentation system
++# doxygen (www.doxygen.org) for a project
++#
++# All text after a hash (#) is considered a comment and will be ignored
++# The format is:
++# TAG = value [value, ...]
++# For lists items can also be appended using:
++# TAG += value [value, ...]
++# Values that contain spaces should be placed between quotes (" ")
++
++#---------------------------------------------------------------------------
++# Project related configuration options
++#---------------------------------------------------------------------------
++
++# This tag specifies the encoding used for all characters in the config file
++# that follow. The default is UTF-8 which is also the encoding used for all
++# text before the first occurrence of this tag. Doxygen uses libiconv (or the
++# iconv built into libc) for the transcoding. See
++# http://www.gnu.org/software/libiconv for the list of possible encodings.
++
++DOXYFILE_ENCODING = UTF-8
++
++# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
++# by quotes) that should identify the project.
++
++PROJECT_NAME = Libav
++
++# 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 =
++
++# With the PROJECT_LOGO tag one can specify an logo or icon that is included
++# in the documentation. The maximum height of the logo should not exceed 55
++# pixels and the maximum width should not exceed 200 pixels. Doxygen will
++# copy the logo to the output directory.
++PROJECT_LOGO =
++
++# 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 = doc/doxy
++
++# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
++# 4096 sub-directories (in 2 levels) under the output directory of each output
++# format and will distribute the generated files over these directories.
++# Enabling this option can be useful when feeding doxygen a huge amount of
++# source files, where putting all generated files in the same directory would
++# otherwise cause performance problems for the file system.
++
++CREATE_SUBDIRS = NO
++
++# 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:
++# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
++# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
++# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
++# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
++# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
++# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
++
++OUTPUT_LANGUAGE = English
++
++# 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
++# brief descriptions will be completely suppressed.
++
++REPEAT_BRIEF = YES
++
++# This tag implements a quasi-intelligent brief description abbreviator
++# that is used to form the text in various listings. Each string
++# in this list, if found as the leading text of the brief description, will be
++# stripped from the text and the result after processing the whole list, is
++# used as the annotated text. Otherwise, the brief description is used as-is.
++# If left blank, the following values are used ("$name" is automatically
++# replaced with the name of the entity): "The $name class" "The $name widget"
++# "The $name file" "is" "provides" "specifies" "contains"
++# "represents" "a" "an" "the"
++
++ABBREVIATE_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 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
++# 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
++# the path. The tag can be used to show relative paths in the file list.
++# If left blank the directory from which doxygen is run is used as the
++# path to strip.
++
++STRIP_FROM_PATH = .
++
++# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
++# the path mentioned in the documentation of a class, which tells
++# the reader which header file to include in order to use a class.
++# If left blank only the name of the header file containing the class
++# definition is used. Otherwise one should specify the include paths that
++# are normally passed to the compiler using the -I flag.
++
++STRIP_FROM_INC_PATH =
++
++# 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 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 regular Qt-style comments
++# (thus requiring an explicit @brief command for a brief description.)
++
++JAVADOC_AUTOBRIEF = YES
++
++# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
++# interpret the first line (until the first dot) of a Qt-style
++# comment as the brief description. If set to NO, the comments
++# will behave just like regular Qt-style comments (thus requiring
++# an explicit \brief command for a brief description.)
++
++QT_AUTOBRIEF = NO
++
++# 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 INHERIT_DOCS tag is set to YES (the default) then an undocumented
++# member inherits the documentation from any documented member that it
++# re-implements.
++
++INHERIT_DOCS = YES
++
++# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
++# a new page for each member. If set to NO, the documentation of a member will
++# be part of the file/class/namespace that contains it.
++
++SEPARATE_MEMBER_PAGES = NO
++
++# 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
++
++# 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 =
++
++# 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 will look different, etc.
++
++OPTIMIZE_OUTPUT_JAVA = NO
++
++# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
++# sources only. Doxygen will then generate output that is more tailored for
++# Fortran.
++
++OPTIMIZE_FOR_FORTRAN = NO
++
++# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
++# sources. Doxygen will then generate output that is tailored for
++# VHDL.
++
++OPTIMIZE_OUTPUT_VHDL = NO
++
++# Doxygen selects the parser to use depending on the extension of the files it
++# parses. With this tag you can assign which parser to use for a given extension.
++# Doxygen has a built-in mapping, but you can override or extend it using this
++# tag. The format is ext=language, where ext is a file extension, and language
++# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
++# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
++# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
++# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
++# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
++
++EXTENSION_MAPPING =
++
++# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
++# to include (a tag file for) the STL sources as input, then you should
++# set this tag to YES in order to let doxygen match functions declarations and
++# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
++# func(std::string) {}). This also make the inheritance and collaboration
++# diagrams that involve STL classes more complete and accurate.
++
++BUILTIN_STL_SUPPORT = NO
++
++# If you use Microsoft's C++/CLI language, you should set this option to YES to
++# enable parsing support.
++
++CPP_CLI_SUPPORT = NO
++
++# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
++# Doxygen will parse them like normal C++ but will assume all classes use public
++# instead of private inheritance when no explicit protection keyword is present.
++
++SIP_SUPPORT = NO
++
++# For Microsoft's IDL there are propget and propput attributes to indicate getter
++# and setter methods for a property. Setting this option to YES (the default)
++# will make doxygen to replace the get and set methods by a property in the
++# documentation. This will only work if the methods are indeed getting or
++# setting a simple type. If this is not the case, or you want to show the
++# methods anyway, you should set this option to NO.
++
++IDL_PROPERTY_SUPPORT = 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
++# all members of a group must be documented explicitly.
++
++DISTRIBUTE_GROUP_DOC = NO
++
++# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
++# the same type (for instance a group of public functions) to be put as a
++# subgroup of that type (e.g. under the Public Functions section). Set it to
++# NO to prevent subgrouping. Alternatively, this can be done per class using
++# the \nosubgrouping command.
++
++SUBGROUPING = YES
++
++# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
++# is documented as struct, union, or enum with the name of the typedef. So
++# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
++# with name TypeT. When disabled the typedef will appear as a member of a file,
++# namespace, or class. And the struct will be named TypeS. This can typically
++# be useful for C code in case the coding convention dictates that all compound
++# types are typedef'ed and only the typedef is referenced, never the tag name.
++
++TYPEDEF_HIDES_STRUCT = NO
++
++# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
++# determine which symbols to keep in memory and which to flush to disk.
++# When the cache is full, less often used symbols will be written to disk.
++# For small to medium size projects (<1000 input files) the default value is
++# probably good enough. For larger projects a too small cache size can cause
++# doxygen to be busy swapping symbols to and from disk most of the time
++# causing a significant performance penality.
++# If the system has enough physical memory increasing the cache will improve the
++# performance by keeping more symbols in memory. Note that the value works on
++# a logarithmic scale so increasing the size by one will rougly double the
++# memory usage. The cache size is given by this formula:
++# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
++# corresponding to a cache size of 2^16 = 65536 symbols
++
++SYMBOL_CACHE_SIZE = 0
++
++#---------------------------------------------------------------------------
++# Build related configuration options
++#---------------------------------------------------------------------------
++
++# 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
++# will be included in the documentation.
++
++EXTRACT_PRIVATE = YES
++
++# 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 set to NO only classes defined in header files are included.
++
++EXTRACT_LOCAL_CLASSES = YES
++
++# This flag is only useful for Objective-C code. When set to YES local
++# methods, which are defined in the implementation section but not in
++# the interface are included in the documentation.
++# If set to NO (the default) only methods in the interface are included.
++
++EXTRACT_LOCAL_METHODS = NO
++
++# If this flag is set to YES, the members of anonymous namespaces will be
++# extracted and appear in the documentation as a namespace called
++# 'anonymous_namespace{file}', where file will be replaced with the base
++# name of the file that contains the anonymous namespace. By default
++# anonymous namespace are hidden.
++
++EXTRACT_ANON_NSPACES = NO
++
++# 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 classes 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
++# 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
++# function's detailed documentation block.
++
++HIDE_IN_BODY_DOCS = NO
++
++# 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
++# and Mac users are advised to set this option to NO.
++
++CASE_SENSE_NAMES = YES
++
++# 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 SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
++# will put a list of the files that are included by a file in the documentation
++# of that file.
++
++SHOW_INCLUDE_FILES = YES
++
++# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
++# will list include files with double quotes in the documentation
++# rather than with sharp brackets.
++
++FORCE_LOCAL_INCLUDES = NO
++
++# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
++# is inserted in the documentation for inline members.
++
++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
++# declaration order.
++
++SORT_MEMBER_DOCS = YES
++
++# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
++# brief documentation of file, namespace and class members alphabetically
++# by member name. If set to NO (the default) the members will appear in
++# declaration order.
++
++SORT_BRIEF_DOCS = NO
++
++# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
++# will sort the (brief and detailed) documentation of class members so that
++# constructors and destructors are listed first. If set to NO (the default)
++# the constructors will appear in the respective orders defined by
++# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
++# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
++# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
++
++SORT_MEMBERS_CTORS_1ST = NO
++
++# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
++# hierarchy of group names into alphabetical order. If set to NO (the default)
++# the group names will appear in their defined order.
++
++SORT_GROUP_NAMES = NO
++
++# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
++# sorted by fully-qualified names, including namespaces. If set to
++# NO (the default), the class list will be sorted only by class name,
++# not including the namespace part.
++# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
++# Note: This option applies only to the class list, not to the
++# alphabetical list.
++
++SORT_BY_SCOPE_NAME = NO
++
++# 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
++# 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
++# 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
++# \deprecated commands in the documentation.
++
++GENERATE_DEPRECATEDLIST= YES
++
++# The ENABLED_SECTIONS tag can be used to enable conditional
++# documentation sections, marked by \if sectionname ... \endif.
++
++ENABLED_SECTIONS =
++
++# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
++# the initial value of a variable or define consists 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 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
++
++# If the sources in your project are distributed over multiple directories
++# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
++# in the documentation. The default is NO.
++
++SHOW_DIRECTORIES = NO
++
++# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
++# This will remove the Files entry from the Quick Index and from the
++# Folder Tree View (if specified). The default is YES.
++
++SHOW_FILES = YES
++
++# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
++# Namespaces page.
++# This will remove the Namespaces entry from the Quick Index
++# and from the Folder Tree View (if specified). The default is YES.
++
++SHOW_NAMESPACES = YES
++
++# The FILE_VERSION_FILTER tag can be used to specify a program or script that
++# doxygen should invoke to get the current version for each file (typically from
++# the version control system). Doxygen will invoke the program by executing (via
++# popen()) the command <command> <input-file>, where <command> is the value of
++# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
++# provided by doxygen. Whatever the program writes to standard output
++# is used as the file version. See the manual for examples.
++
++FILE_VERSION_FILTER =
++
++# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
++# by doxygen. The layout file controls the global structure of the generated
++# output files in an output format independent way. The create the layout file
++# that represents doxygen's defaults, run doxygen with the -l option.
++# You can optionally specify a file name after the option, if omitted
++# DoxygenLayout.xml will be used as the name of the layout file.
++
++LAYOUT_FILE =
++
++#---------------------------------------------------------------------------
++# configuration options related to warning and progress messages
++#---------------------------------------------------------------------------
++
++# 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 = YES
++
++# 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
++# automatically be disabled.
++
++WARN_IF_UNDOCUMENTED = YES
++
++# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
++# potential errors in the documentation, such as not documenting some
++# parameters in a documented function, or documenting parameters that
++# don't exist or using markup commands wrongly.
++
++WARN_IF_DOC_ERROR = YES
++
++# This WARN_NO_PARAMDOC option can be abled to get warnings for
++# functions that are documented, but have no documentation for their parameters
++# or return value. If set to NO (the default) doxygen will only warn about
++# wrong or incomplete parameter documentation, but not about the absence of
++# documentation.
++
++WARN_NO_PARAMDOC = NO
++
++# 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. Optionally the format may contain
++# $version, which will be replaced by the version of the file (if it could
++# be obtained via FILE_VERSION_FILTER)
++
++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
++# to stderr.
++
++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
++# with spaces.
++
++INPUT =
++
++# This tag can be used to specify the character encoding of the source files
++# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
++# also the default input encoding. Doxygen uses libiconv (or the iconv built
++# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
++# the list of possible encodings.
++
++INPUT_ENCODING = UTF-8
++
++# 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 *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
++
++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.
++# 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
++# subdirectory from a directory tree whose root is specified with the INPUT tag.
++
++EXCLUDE =
++
++# 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
++# certain files from those directories. Note that the wildcards are matched
++# against the file with absolute path, so to exclude all test directories
++# for example use the pattern */test/*
++
++EXCLUDE_PATTERNS = *.git \
++ *.d
++
++# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
++# (namespaces, classes, functions, etc.) that should be excluded from the
++# output. The symbol name can be a fully qualified name, a word, or if the
++# wildcard * is used, a substring. Examples: ANamespace, AClass,
++# AClass::ANamespace, ANamespace::*Test
++
++EXCLUDE_SYMBOLS =
++
++# 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 = libavcodec/ \
++ libavformat/
++
++# If the value of the EXAMPLE_PATH tag contains directories, you can use the
++# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
++# and *.h) to filter out the source-files in the directories. If left
++# blank all files are included.
++
++EXAMPLE_PATTERNS = *-example.c
++
++# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
++# searched for input files to be used with the \include or \dontinclude
++# 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 command).
++
++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
++# to standard output.
++# If FILTER_PATTERNS is specified, this tag will be
++# ignored.
++
++INPUT_FILTER =
++
++# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
++# basis.
++# Doxygen will compare the file name with each pattern and apply the
++# filter if there is a match.
++# The filters are a list of the form:
++# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
++# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
++# is applied to all files.
++
++FILTER_PATTERNS =
++
++# 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
++# be generated. Documented entities will be cross-referenced with these sources.
++# Note: To get rid of all source code in the generated output, make sure also
++# VERBATIM_HEADERS is set to NO.
++
++SOURCE_BROWSER = YES
++
++# 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
++# fragments. Normal C and C++ comments will always remain visible.
++
++STRIP_CODE_COMMENTS = YES
++
++# If the REFERENCED_BY_RELATION tag is set to YES
++# 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
++# then for each documented function all documented entities
++# called/used by that function will be listed.
++
++REFERENCES_RELATION = NO
++
++# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
++# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
++# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
++# link to the source code.
++# Otherwise they will link to the documentation.
++
++REFERENCES_LINK_SOURCE = YES
++
++# If the USE_HTAGS tag is set to YES then the references to source code
++# will point to the HTML generated by the htags(1) tool instead of doxygen
++# built-in source browser. The htags tool is part of GNU's global source
++# tagging system (see http://www.gnu.org/software/global/global.html). You
++# will need version 4.8.6 or higher.
++
++USE_HTAGS = 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
++# which an include is specified. Set to NO to disable this.
++
++VERBATIM_HEADERS = YES
++
++#---------------------------------------------------------------------------
++# 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
++# 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
++# in which this list will be split (can be a number in the range [1..20])
++
++COLS_IN_ALPHA_INDEX = 2
++
++# 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 =
++
++#---------------------------------------------------------------------------
++# configuration options related to the HTML output
++#---------------------------------------------------------------------------
++
++# 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
++# 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
++# 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
++# standard header.
++
++HTML_HEADER = doc/doxy/header.html
++
++# 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 = doc/doxy/footer.html
++
++# 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. Note that doxygen will try to copy
++# the style sheet file to the HTML output directory, so don't put your own
++# stylesheet in the HTML output directory as well, or it will be erased!
++
++HTML_STYLESHEET = doc/doxy/doxy_stylesheet.css
++
++# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
++# Doxygen will adjust the colors in the stylesheet and background images
++# according to this color. Hue is specified as an angle on a colorwheel,
++# see http://en.wikipedia.org/wiki/Hue for more information.
++# For instance the value 0 represents red, 60 is yellow, 120 is green,
++# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
++# The allowed range is 0 to 359.
++
++HTML_COLORSTYLE_HUE = 120
++
++# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
++# the colors in the HTML output. For a value of 0 the output will use
++# grayscales only. A value of 255 will produce the most vivid colors.
++
++HTML_COLORSTYLE_SAT = 100
++
++# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
++# the luminance component of the colors in the HTML output. Values below
++# 100 gradually make the output lighter, whereas values above 100 make
++# the output darker. The value divided by 100 is the actual gamma applied,
++# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
++# and 100 does not change the gamma.
++
++HTML_COLORSTYLE_GAMMA = 80
++
++# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
++# page will contain the date and time when the page was generated. Setting
++# this to NO can help when comparing the output of multiple runs.
++
++HTML_TIMESTAMP = YES
++
++# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
++# files or namespaces will be aligned in HTML using tables. If set to
++# NO a bullet list will be used.
++
++HTML_ALIGN_MEMBERS = YES
++
++# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
++# documentation will contain sections that can be hidden and shown after the
++# page has loaded. For this to work a browser that supports
++# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
++# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
++
++HTML_DYNAMIC_SECTIONS = NO
++
++# If the GENERATE_DOCSET tag is set to YES, additional index files
++# will be generated that can be used as input for Apple's Xcode 3
++# integrated development environment, introduced with OS X 10.5 (Leopard).
++# To create a documentation set, doxygen will generate a Makefile in the
++# HTML output directory. Running make will produce the docset in that
++# directory and running "make install" will install the docset in
++# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
++# it at startup.
++# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
++# for more information.
++
++GENERATE_DOCSET = NO
++
++# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
++# feed. A documentation feed provides an umbrella under which multiple
++# documentation sets from a single provider (such as a company or product suite)
++# can be grouped.
++
++DOCSET_FEEDNAME = "Doxygen generated docs"
++
++# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
++# should uniquely identify the documentation set bundle. This should be a
++# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
++# will append .docset to the name.
++
++DOCSET_BUNDLE_ID = org.doxygen.Project
++
++# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
++# the documentation publisher. This should be a reverse domain-name style
++# string, e.g. com.mycompany.MyDocSet.documentation.
++
++DOCSET_PUBLISHER_ID = org.doxygen.Publisher
++
++# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
++
++DOCSET_PUBLISHER_NAME = Publisher
++
++# If the GENERATE_HTMLHELP tag is set to YES, additional index files
++# will be generated that can be used as input for tools like the
++# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
++# of the generated HTML documentation.
++
++GENERATE_HTMLHELP = NO
++
++# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
++# be used to specify the file name of the resulting .chm file. You
++# can add a path in front of the file if the result should not be
++# written to the html output directory.
++
++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
++# the HTML help compiler on the generated index.hhp.
++
++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
++# it should be included in the master .chm file (NO).
++
++GENERATE_CHI = NO
++
++# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
++# is used to encode HtmlHelp index (hhk), content (hhc) and project file
++# content.
++
++CHM_INDEX_ENCODING =
++
++# 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
++# to the contents of the HTML help documentation and to the tree view.
++
++TOC_EXPAND = NO
++
++# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
++# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
++# that can be used as input for Qt's qhelpgenerator to generate a
++# Qt Compressed Help (.qch) of the generated HTML documentation.
++
++GENERATE_QHP = NO
++
++# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
++# be used to specify the file name of the resulting .qch file.
++# The path specified is relative to the HTML output folder.
++
++QCH_FILE =
++
++# The QHP_NAMESPACE tag specifies the namespace to use when generating
++# Qt Help Project output. For more information please see
++# http://doc.trolltech.com/qthelpproject.html#namespace
++
++QHP_NAMESPACE = org.doxygen.Project
++
++# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
++# Qt Help Project output. For more information please see
++# http://doc.trolltech.com/qthelpproject.html#virtual-folders
++
++QHP_VIRTUAL_FOLDER = doc
++
++# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
++# add. For more information please see
++# http://doc.trolltech.com/qthelpproject.html#custom-filters
++
++QHP_CUST_FILTER_NAME =
++
++# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
++# custom filter to add. For more information please see
++# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
++# Qt Help Project / Custom Filters</a>.
++
++QHP_CUST_FILTER_ATTRS =
++
++# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
++# project's
++# filter section matches.
++# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
++# Qt Help Project / Filter Attributes</a>.
++
++QHP_SECT_FILTER_ATTRS =
++
++# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
++# be used to specify the location of Qt's qhelpgenerator.
++# If non-empty doxygen will try to run qhelpgenerator on the generated
++# .qhp file.
++
++QHG_LOCATION =
++
++# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
++# will be generated, which together with the HTML files, form an Eclipse help
++# plugin. To install this plugin and make it available under the help contents
++# menu in Eclipse, the contents of the directory containing the HTML and XML
++# files needs to be copied into the plugins directory of eclipse. The name of
++# the directory within the plugins directory should be the same as
++# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
++# the help appears.
++
++GENERATE_ECLIPSEHELP = NO
++
++# A unique identifier for the eclipse help plugin. When installing the plugin
++# the directory name containing the HTML and XML files should also have
++# this name.
++
++ECLIPSE_DOC_ID = org.doxygen.Project
++
++# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
++# top of each HTML page. The value NO (the default) enables the index and
++# the value YES disables it.
++
++DISABLE_INDEX = NO
++
++# 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
++
++# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
++# structure should be generated to display hierarchical information.
++# If the tag value is set to YES, a side panel will be generated
++# containing a tree-like index structure (just like the one that
++# is generated for HTML Help). For this to work a browser that supports
++# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
++# Windows users are probably better off using the HTML help feature.
++
++GENERATE_TREEVIEW = NO
++
++# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
++# and Class Hierarchy pages using a tree view instead of an ordered list.
++
++USE_INLINE_TREES = NO
++
++# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
++# used to set the initial width (in pixels) of the frame in which the tree
++# is shown.
++
++TREEVIEW_WIDTH = 250
++
++# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
++# links to external symbols imported via tag files in a separate window.
++
++EXT_LINKS_IN_WINDOW = NO
++
++# Use this tag to change the font size of Latex formulas included
++# as images in the HTML documentation. The default is 10. Note that
++# when you change the font size after a successful doxygen run you need
++# to manually remove any form_*.png images from the HTML output directory
++# to force them to be regenerated.
++
++FORMULA_FONTSIZE = 10
++
++# Use the FORMULA_TRANPARENT tag to determine whether or not the images
++# generated for formulas are transparent PNGs. Transparent PNGs are
++# not supported properly for IE 6.0, but are supported on all modern browsers.
++# Note that when changing this option you need to delete any form_*.png files
++# in the HTML output before the changes have effect.
++
++FORMULA_TRANSPARENT = YES
++
++# When the SEARCHENGINE tag is enabled doxygen will generate a search box
++# for the HTML output. The underlying search engine uses javascript
++# and DHTML and should work on any modern browser. Note that when using
++# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
++# (GENERATE_DOCSET) there is already a search function so this one should
++# typically be disabled. For large projects the javascript based search engine
++# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
++
++SEARCHENGINE = NO
++
++# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
++# implemented using a PHP enabled web server instead of at the web client
++# using Javascript. Doxygen will generate the search PHP script and index
++# file to put on the web server. The advantage of the server
++# based approach is that it scales better to large projects and allows
++# full text search. The disadvances is that it is more difficult to setup
++# and does not have live searching capabilities.
++
++SERVER_BASED_SEARCH = NO
++
++#---------------------------------------------------------------------------
++# configuration options related to the LaTeX output
++#---------------------------------------------------------------------------
++
++# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
++# generate Latex output.
++
++GENERATE_LATEX = NO
++
++# 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
++# invoked. If left blank `latex' will be used as the default command name.
++# Note that when enabling USE_PDFLATEX this option is only used for
++# generating bitmaps for formulas in the HTML output, but not in the
++# Makefile that is written to the output directory.
++
++LATEX_CMD_NAME = latex
++
++# 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
++# 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
++# 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
++# packages that should be included in the LaTeX output.
++
++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
++# standard header. Notice: only use this tag if you know what you are doing!
++
++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
++# 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
++# 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.
++# This option is also used when generating formulas in HTML.
++
++LATEX_BATCHMODE = NO
++
++# If LATEX_HIDE_INDICES is set to YES then doxygen will not
++# include the index chapters (such as File Index, Compound Index, etc.)
++# in the output.
++
++LATEX_HIDE_INDICES = NO
++
++# If LATEX_SOURCE_CODE is set to YES then doxygen will include
++# source code with syntax highlighting in the LaTeX output.
++# Note that which sources are shown also depends on other settings
++# such as SOURCE_BROWSER.
++
++LATEX_SOURCE_CODE = NO
++
++#---------------------------------------------------------------------------
++# configuration options related to the RTF output
++#---------------------------------------------------------------------------
++
++# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
++# The RTF output is optimized 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
++# 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
++# 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.
++# 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 assignments. You only have to provide
++# replacements, missing definitions are set to their default value.
++
++RTF_STYLESHEET_FILE =
++
++# Set optional variables used in the generation of an rtf document.
++# Syntax is similar to doxygen's config 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
++# 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
++# 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 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
++# 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.
++
++GENERATE_XML = NO
++
++# The XML_OUTPUT tag is used to specify where the XML 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 `xml' will be used as the default path.
++
++XML_OUTPUT = xml
++
++# 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 =
++
++# 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 =
++
++# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
++# dump the program listings (including syntax highlighting
++# and cross-referencing information) to the XML output. Note that
++# enabling this will significantly increase the size of the XML output.
++
++XML_PROGRAMLISTING = YES
++
++#---------------------------------------------------------------------------
++# 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
++# 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
++# 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
++# 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
++# 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
++# Makefile don't overwrite each other's variables.
++
++PERLMOD_MAKEVAR_PREFIX =
++
++#---------------------------------------------------------------------------
++# 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
++# 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
++# 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
++# PREDEFINED and EXPAND_AS_DEFINED tags.
++
++EXPAND_ONLY_PREDEF = YES
++
++# 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 preprocessor.
++
++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
++# be used.
++
++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
++# omitted =1 is assumed. To prevent a macro definition from being
++# undefined via #undef or recursively expanded use the := operator
++# instead of the = operator.
++
++PREDEFINED = "__attribute__(x)=" \
++ "RENAME(x)=x ## _TMPL" \
++ "DEF(x)=x ## _TMPL" \
++ HAVE_AV_CONFIG_H \
++ HAVE_MMX \
++ HAVE_MMXEXT \
++ HAVE_AMD3DNOW \
++ "DECLARE_ALIGNED(a,t,n)=t n" \
++ "offsetof(x,y)=0x42"
++
++# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
++# this tag can be used to specify a list of macro names that should be expanded.
++# The macro definition that is found in the sources will be used.
++# Use the PREDEFINED tag if you want to use a different macro definition.
++
++EXPAND_AS_DEFINED = declare_idct \
++ READ_PAR_DATA \
++
++# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
++# doxygen's preprocessor will remove all function-like macros that are alone
++# 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::additions related to external references
++#---------------------------------------------------------------------------
++
++# The TAGFILES option can be used to specify one or more tagfiles.
++# Optionally an initial location of the external documentation
++# can be added for each tagfile. The format of a tag file without
++# this location is as follows:
++#
++# TAGFILES = file1 file2 ...
++# Adding location for the tag files is done as follows:
++#
++# TAGFILES = file1=loc1 "file2 = loc2" ...
++# where "loc1" and "loc2" can be relative or absolute paths or
++# URLs. If a location is present for each tag, the installdox tool
++# does not have to be run to correct the links.
++# Note that each tag file must have a unique name
++# (where the name does NOT include the path)
++# If a tag file is not located in the directory in which doxygen
++# is run, you must also specify the path to the tagfile here.
++
++TAGFILES =
++
++# 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 =
++
++# 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
++# be listed.
++
++EXTERNAL_GROUPS = YES
++
++# 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
++#---------------------------------------------------------------------------
++
++# 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 superseded by the HAVE_DOT option below. This is only a
++# fallback. It is recommended to install and use dot, since it yields more
++# powerful graphs.
++
++CLASS_DIAGRAMS = YES
++
++# You can define message sequence charts within doxygen comments using the \msc
++# command. Doxygen will then run the mscgen tool (see
++# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
++# documentation. The MSCGEN_PATH tag allows you to specify the directory where
++# the mscgen tool resides. If left empty the tool is assumed to be found in the
++# default search path.
++
++MSCGEN_PATH =
++
++# 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
++# have no effect if this option is set to NO (the default)
++
++HAVE_DOT = NO
++
++# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
++# allowed to run in parallel. When set to 0 (the default) doxygen will
++# base this on the number of processors available in the system. You can set it
++# explicitly to a value larger than 0 to get control over the balance
++# between CPU load and processing speed.
++
++DOT_NUM_THREADS = 0
++
++# By default doxygen will write a font called FreeSans.ttf to the output
++# directory and reference it in all dot files that doxygen generates. This
++# font does not include all possible unicode characters however, so when you need
++# these (or just want a differently looking font) you can specify the font name
++# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
++# which can be done by putting it in a standard location or by setting the
++# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
++# containing the font.
++
++DOT_FONTNAME = FreeSans
++
++# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
++# The default size is 10pt.
++
++DOT_FONTSIZE = 10
++
++# By default doxygen will tell dot to use the output directory to look for the
++# FreeSans.ttf font (which doxygen will put there itself). If you specify a
++# different font using DOT_FONTNAME you can set the path where dot
++# can find it using this tag.
++
++DOT_FONTPATH =
++
++# 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
++# class references variables) of the class with other documented classes.
++
++COLLABORATION_GRAPH = YES
++
++# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
++# will generate a graph for groups, showing the direct groups dependencies
++
++GROUP_GRAPHS = YES
++
++# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
++# collaboration diagrams in a style similar to the OMG's Unified Modeling
++# Language.
++
++UML_LOOK = NO
++
++# 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
++# 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
++# indirectly include this file.
++
++INCLUDED_BY_GRAPH = YES
++
++# If the CALL_GRAPH and HAVE_DOT options are set to YES then
++# doxygen will generate a call dependency graph for every global function
++# or class method. Note that enabling this option will significantly increase
++# the time of a run. So in most cases it will be better to enable call graphs
++# for selected functions only using the \callgraph command.
++
++CALL_GRAPH = NO
++
++# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
++# doxygen will generate a caller dependency graph for every global function
++# or class method. Note that enabling this option will significantly increase
++# the time of a run. So in most cases it will be better to enable caller
++# graphs for selected functions only using the \callergraph command.
++
++CALLER_GRAPH = NO
++
++# 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
++
++# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
++# then doxygen will show the dependencies a directory has on other directories
++# in a graphical way. The dependency relations are determined by the #include
++# relations between the files in the directories.
++
++DIRECTORY_GRAPH = YES
++
++# 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
++# found. If left blank, it is assumed the dot tool can be found in the 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
++# \dotfile command).
++
++DOTFILE_DIRS =
++
++# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
++# nodes that will be shown in the graph. If the number of nodes in a graph
++# becomes larger than this value, doxygen will truncate the graph, which is
++# visualized by representing a node as a red box. Note that doxygen if the
++# number of direct children of the root node in a graph is already larger than
++# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
++# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
++
++DOT_GRAPH_MAX_NODES = 50
++
++# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
++# graphs generated by dot. A depth value of 3 means that only nodes reachable
++# from the root by following a path via at most 3 edges will be shown. Nodes
++# that lay further from the root node will be omitted. Note that setting this
++# option to 1 or 2 may greatly reduce the computation time needed for large
++# code bases. Also note that the size of a graph can be further restricted by
++# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
++
++MAX_DOT_GRAPH_DEPTH = 0
++
++# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
++# background. This is disabled by default, because dot on Windows does not
++# seem to support this out of the box. Warning: Depending on the platform used,
++# enabling this option may lead to badly anti-aliased labels on the edges of
++# a graph (i.e. they become hard to read).
++
++DOT_TRANSPARENT = YES
++
++# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
++# files in one run (i.e. multiple -o and -T options on the command line). This
++# makes dot run faster, but since only newer versions of dot (>1.8.10)
++# support this, this feature is disabled by default.
++
++DOT_MULTI_TARGETS = NO
++
++# 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 intermediate dot files that are used to generate
++# the various graphs.
++
++DOT_CLEANUP = YES
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0007-lavc-use-the-correct-API-version-guard-macro-for-avc.patch b/debian/patches/post-9beta2/0007-lavc-use-the-correct-API-version-guard-macro-for-avc.patch
new file mode 100644
index 0000000..7f546ff
--- /dev/null
+++ b/debian/patches/post-9beta2/0007-lavc-use-the-correct-API-version-guard-macro-for-avc.patch
@@ -0,0 +1,26 @@
+From a5ef830b1226273c35d4baa1c2e4e7e1c9de7c7d Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 13:25:53 -0400
+Subject: [PATCH 007/204] lavc: use the correct API version guard macro for
+ avcodec_encode_audio()
+
+---
+ libavcodec/utils.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/utils.c b/libavcodec/utils.c
+index 5e22b9f..10230ca 100644
+--- a/libavcodec/utils.c
++++ b/libavcodec/utils.c
+@@ -1073,7 +1073,7 @@ end:
+ return ret;
+ }
+
+-#if FF_API_OLD_DECODE_AUDIO
++#if FF_API_OLD_ENCODE_AUDIO
+ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
+ uint8_t *buf, int buf_size,
+ const short *samples)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0008-atrac3-return-an-error-if-extradata_size-is-not-a-sp.patch b/debian/patches/post-9beta2/0008-atrac3-return-an-error-if-extradata_size-is-not-a-sp.patch
new file mode 100644
index 0000000..56b1222
--- /dev/null
+++ b/debian/patches/post-9beta2/0008-atrac3-return-an-error-if-extradata_size-is-not-a-sp.patch
@@ -0,0 +1,26 @@
+From 44d854a518f97cb65090420b0b9f55611a0ea932 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 10:44:55 -0400
+Subject: [PATCH 008/204] atrac3: return an error if extradata_size is not a
+ specific known size
+
+Also fixes 3 compiler warnings about using uninitialized variables.
+---
+ libavcodec/atrac3.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
+index 9cf9892..5bf992f 100644
+--- a/libavcodec/atrac3.c
++++ b/libavcodec/atrac3.c
+@@ -912,6 +912,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
+ } else {
+ av_log(NULL, AV_LOG_ERROR, "Unknown extradata size %d.\n",
+ avctx->extradata_size);
++ return AVERROR(EINVAL);
+ }
+
+ /* Check the extradata */
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0009-lavc-fix-documentation-for-AVCodecContext.delay.patch b/debian/patches/post-9beta2/0009-lavc-fix-documentation-for-AVCodecContext.delay.patch
new file mode 100644
index 0000000..c684daa
--- /dev/null
+++ b/debian/patches/post-9beta2/0009-lavc-fix-documentation-for-AVCodecContext.delay.patch
@@ -0,0 +1,25 @@
+From c68317ebbe4915035df0b08c23eea7a0b80ab881 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 2 Oct 2012 11:38:34 -0400
+Subject: [PATCH 009/204] lavc: fix documentation for AVCodecContext.delay
+
+---
+ libavcodec/avcodec.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
+index 64d45db..c505a92 100644
+--- a/libavcodec/avcodec.h
++++ b/libavcodec/avcodec.h
+@@ -1442,7 +1442,7 @@ typedef struct AVCodecContext {
+ int ticks_per_frame;
+
+ /**
+- * Encoder delay.
++ * Codec delay.
+ *
+ * Video:
+ * Number of frames the decoded output will be delayed relative to the
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0010-lavc-initialize-output-AVFrame-before-decoding.patch b/debian/patches/post-9beta2/0010-lavc-initialize-output-AVFrame-before-decoding.patch
new file mode 100644
index 0000000..d27289e
--- /dev/null
+++ b/debian/patches/post-9beta2/0010-lavc-initialize-output-AVFrame-before-decoding.patch
@@ -0,0 +1,38 @@
+From 1bc64c2814d409d3cc129c27c493ee915bebdc4a Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Tue, 23 Oct 2012 08:22:23 +0200
+Subject: [PATCH 010/204] lavc: initialize output AVFrame before decoding.
+
+Avoids memleaks with audio when extended_data is nontrivial and the user
+doesn't reset the frame.
+Shouldn't have any effect for video for now, but might be useful in the
+future.
+---
+ libavcodec/utils.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libavcodec/utils.c b/libavcodec/utils.c
+index 10230ca..8daacbe 100644
+--- a/libavcodec/utils.c
++++ b/libavcodec/utils.c
+@@ -1305,6 +1305,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
+ avctx->pkt = avpkt;
+ apply_param_change(avctx, avpkt);
+
++ avcodec_get_frame_defaults(picture);
++
+ if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
+ if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
+ ret = ff_thread_decode_frame(avctx, picture, got_picture_ptr,
+@@ -1400,6 +1402,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
+
+ apply_param_change(avctx, avpkt);
+
++ avcodec_get_frame_defaults(frame);
++
+ if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) {
+ ret = avctx->codec->decode(avctx, frame, got_frame_ptr, avpkt);
+ if (ret >= 0 && *got_frame_ptr) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0011-avconv-remove-now-unneeded-calls-to-avcodec_get_fram.patch b/debian/patches/post-9beta2/0011-avconv-remove-now-unneeded-calls-to-avcodec_get_fram.patch
new file mode 100644
index 0000000..5e44fad
--- /dev/null
+++ b/debian/patches/post-9beta2/0011-avconv-remove-now-unneeded-calls-to-avcodec_get_fram.patch
@@ -0,0 +1,35 @@
+From 8e84f2055c4170e502d36db3539b5e243a5b6cca Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Tue, 23 Oct 2012 08:32:56 +0200
+Subject: [PATCH 011/204] avconv: remove now unneeded calls to
+ avcodec_get_frame_defaults().
+
+---
+ avconv.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/avconv.c b/avconv.c
+index 6f67711..bf1e2fa 100644
+--- a/avconv.c
++++ b/avconv.c
+@@ -1079,8 +1079,6 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
+
+ if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame()))
+ return AVERROR(ENOMEM);
+- else
+- avcodec_get_frame_defaults(ist->decoded_frame);
+ decoded_frame = ist->decoded_frame;
+
+ ret = avcodec_decode_audio4(avctx, decoded_frame, got_output, pkt);
+@@ -1220,8 +1218,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
+
+ if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame()))
+ return AVERROR(ENOMEM);
+- else
+- avcodec_get_frame_defaults(ist->decoded_frame);
+ decoded_frame = ist->decoded_frame;
+
+ ret = avcodec_decode_video2(ist->st->codec,
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0012-g.723.1-add-missing-CODEC_CAP_DR1.patch b/debian/patches/post-9beta2/0012-g.723.1-add-missing-CODEC_CAP_DR1.patch
new file mode 100644
index 0000000..9c1390d
--- /dev/null
+++ b/debian/patches/post-9beta2/0012-g.723.1-add-missing-CODEC_CAP_DR1.patch
@@ -0,0 +1,24 @@
+From 5a9567631a909a4c76dc678ebd603ffc4d57262d Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 17 Oct 2012 12:16:00 +0200
+Subject: [PATCH 012/204] g.723.1: add missing CODEC_CAP_DR1
+
+---
+ libavcodec/g723_1.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
+index 3d4fa46..5c213da 100644
+--- a/libavcodec/g723_1.c
++++ b/libavcodec/g723_1.c
+@@ -1376,6 +1376,6 @@ AVCodec ff_g723_1_decoder = {
+ .init = g723_1_decode_init,
+ .decode = g723_1_decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("G.723.1"),
+- .capabilities = CODEC_CAP_SUBFRAMES,
++ .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
+ .priv_class = &g723_1dec_class,
+ };
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0013-asfdec-cosmetics-reformat-ff_asf_parse_packet.patch b/debian/patches/post-9beta2/0013-asfdec-cosmetics-reformat-ff_asf_parse_packet.patch
new file mode 100644
index 0000000..1c2527e
--- /dev/null
+++ b/debian/patches/post-9beta2/0013-asfdec-cosmetics-reformat-ff_asf_parse_packet.patch
@@ -0,0 +1,244 @@
+From 292a08cbab3392a693b1c3b03a9cac6a1b65d304 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Sat, 20 Oct 2012 17:15:57 +0200
+Subject: [PATCH 013/204] asfdec: cosmetics, reformat ff_asf_parse_packet()
+
+---
+ libavformat/asfdec.c | 138 ++++++++++++++++++++++++++------------------------
+ 1 file changed, 72 insertions(+), 66 deletions(-)
+
+diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
+index 5fe8e96..c6b322d 100644
+--- a/libavformat/asfdec.c
++++ b/libavformat/asfdec.c
+@@ -1002,13 +1002,15 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
+ ASFStream *asf_st = 0;
+ for (;;) {
+ int ret;
+- if(pb->eof_reached)
++
++ if (pb->eof_reached)
+ return AVERROR_EOF;
+- if (asf->packet_size_left < FRAME_HEADER_SIZE
+- || asf->packet_segments < 1) {
+- //asf->packet_size_left <= asf->packet_padsize) {
++
++ if (asf->packet_size_left < FRAME_HEADER_SIZE ||
++ asf->packet_segments < 1) {
+ int ret = asf->packet_size_left + asf->packet_padsize;
+- assert(ret>=0);
++
++ assert(ret >= 0);
+ /* fail safe */
+ avio_skip(pb, ret);
+
+@@ -1019,19 +1021,19 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
+ return 1;
+ }
+ if (asf->packet_time_start == 0) {
+- if(asf_read_frame_header(s, pb) < 0){
+- asf->packet_segments= 0;
++ if (asf_read_frame_header(s, pb) < 0) {
++ asf->packet_segments = 0;
+ continue;
+ }
+- if (asf->stream_index < 0
+- || s->streams[asf->stream_index]->discard >= AVDISCARD_ALL
+- || (!asf->packet_key_frame && s->streams[asf->stream_index]->discard >= AVDISCARD_NONKEY)
+- ) {
++ if (asf->stream_index < 0 ||
++ s->streams[asf->stream_index]->discard >= AVDISCARD_ALL ||
++ (!asf->packet_key_frame &&
++ s->streams[asf->stream_index]->discard >= AVDISCARD_NONKEY)) {
+ asf->packet_time_start = 0;
+ /* unhandled packet (should not happen) */
+ avio_skip(pb, asf->packet_frag_size);
+ asf->packet_size_left -= asf->packet_frag_size;
+- if(asf->stream_index < 0)
++ if (asf->stream_index < 0)
+ av_log(s, AV_LOG_ERROR, "ff asf skip %d (unknown stream)\n", asf->packet_frag_size);
+ continue;
+ }
+@@ -1042,12 +1044,11 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
+ if (asf->packet_replic_size == 1) {
+ // frag_offset is here used as the beginning timestamp
+ asf->packet_frag_timestamp = asf->packet_time_start;
+- asf->packet_time_start += asf->packet_time_delta;
+- asf->packet_obj_size = asf->packet_frag_size = avio_r8(pb);
++ asf->packet_time_start += asf->packet_time_delta;
++ asf->packet_obj_size = asf->packet_frag_size = avio_r8(pb);
+ asf->packet_size_left--;
+ asf->packet_multi_size--;
+- if (asf->packet_multi_size < asf->packet_obj_size)
+- {
++ if (asf->packet_multi_size < asf->packet_obj_size) {
+ asf->packet_time_start = 0;
+ avio_skip(pb, asf->packet_multi_size);
+ asf->packet_size_left -= asf->packet_multi_size;
+@@ -1055,29 +1056,30 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
+ }
+ asf->packet_multi_size -= asf->packet_obj_size;
+ }
+- if( /*asf->packet_frag_size == asf->packet_obj_size*/
+- asf_st->frag_offset + asf->packet_frag_size <= asf_st->pkt.size
+- && asf_st->frag_offset + asf->packet_frag_size > asf->packet_obj_size){
++ if (asf_st->frag_offset + asf->packet_frag_size <= asf_st->pkt.size &&
++ asf_st->frag_offset + asf->packet_frag_size > asf->packet_obj_size) {
+ av_log(s, AV_LOG_INFO, "ignoring invalid packet_obj_size (%d %d %d %d)\n",
+- asf_st->frag_offset, asf->packet_frag_size,
+- asf->packet_obj_size, asf_st->pkt.size);
+- asf->packet_obj_size= asf_st->pkt.size;
++ asf_st->frag_offset, asf->packet_frag_size,
++ asf->packet_obj_size, asf_st->pkt.size);
++ asf->packet_obj_size = asf_st->pkt.size;
+ }
+
+- if ( asf_st->pkt.size != asf->packet_obj_size
+- || asf_st->frag_offset + asf->packet_frag_size > asf_st->pkt.size) { //FIXME is this condition sufficient?
+- if(asf_st->pkt.data){
+- av_log(s, AV_LOG_INFO, "freeing incomplete packet size %d, new %d\n", asf_st->pkt.size, asf->packet_obj_size);
++ if (asf_st->pkt.size != asf->packet_obj_size ||
++ //FIXME is this condition sufficient?
++ asf_st->frag_offset + asf->packet_frag_size > asf_st->pkt.size) {
++ if (asf_st->pkt.data) {
++ av_log(s, AV_LOG_INFO, "freeing incomplete packet size %d, "
++ "new %d\n", asf_st->pkt.size, asf->packet_obj_size);
+ asf_st->frag_offset = 0;
+ av_free_packet(&asf_st->pkt);
+ }
+ /* new packet */
+ av_new_packet(&asf_st->pkt, asf->packet_obj_size);
+- asf_st->seq = asf->packet_seq;
+- asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
++ asf_st->seq = asf->packet_seq;
++ asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
+ asf_st->pkt.stream_index = asf->stream_index;
+- asf_st->pkt.pos =
+- asf_st->packet_pos= asf->packet_pos;
++ asf_st->pkt.pos = asf_st->packet_pos = asf->packet_pos;
++
+ if (asf_st->pkt.data && asf_st->palette_changed) {
+ uint8_t *pal;
+ pal = av_packet_new_side_data(&asf_st->pkt, AV_PKT_DATA_PALETTE,
+@@ -1108,18 +1110,19 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
+ if (asf->packet_size_left < 0)
+ continue;
+
+- if( asf->packet_frag_offset >= asf_st->pkt.size
+- || asf->packet_frag_size > asf_st->pkt.size - asf->packet_frag_offset){
++ if (asf->packet_frag_offset >= asf_st->pkt.size ||
++ asf->packet_frag_size > asf_st->pkt.size - asf->packet_frag_offset) {
+ av_log(s, AV_LOG_ERROR, "packet fragment position invalid %u,%u not in %u\n",
+- asf->packet_frag_offset, asf->packet_frag_size, asf_st->pkt.size);
++ asf->packet_frag_offset, asf->packet_frag_size, asf_st->pkt.size);
+ continue;
+ }
+
+ ret = avio_read(pb, asf_st->pkt.data + asf->packet_frag_offset,
+- asf->packet_frag_size);
++ asf->packet_frag_size);
+ if (ret != asf->packet_frag_size) {
+ if (ret < 0 || asf->packet_frag_offset + ret == 0)
+ return ret < 0 ? ret : AVERROR_EOF;
++
+ if (asf_st->ds_span > 1) {
+ // scrambling, we can either drop it completely or fill the remainder
+ // TODO: should we fill the whole packet instead of just the current
+@@ -1127,9 +1130,10 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
+ memset(asf_st->pkt.data + asf->packet_frag_offset + ret, 0,
+ asf->packet_frag_size - ret);
+ ret = asf->packet_frag_size;
+- } else
++ } else {
+ // no scrambling, so we can return partial packets
+ av_shrink_packet(&asf_st->pkt, asf->packet_frag_offset + ret);
++ }
+ }
+ if (s->key && s->keylen == 20)
+ ff_asfcrypt_dec(s->key, asf_st->pkt.data + asf->packet_frag_offset,
+@@ -1138,11 +1142,11 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
+ /* test if whole packet is read */
+ if (asf_st->frag_offset == asf_st->pkt.size) {
+ //workaround for macroshit radio DVR-MS files
+- if( s->streams[asf->stream_index]->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO
+- && asf_st->pkt.size > 100){
++ if (s->streams[asf->stream_index]->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO &&
++ asf_st->pkt.size > 100) {
+ int i;
+- for(i=0; i<asf_st->pkt.size && !asf_st->pkt.data[i]; i++);
+- if(i == asf_st->pkt.size){
++ for (i = 0; i < asf_st->pkt.size && !asf_st->pkt.data[i]; i++);
++ if (i == asf_st->pkt.size) {
+ av_log(s, AV_LOG_DEBUG, "discarding ms fart\n");
+ asf_st->frag_offset = 0;
+ av_free_packet(&asf_st->pkt);
+@@ -1152,37 +1156,39 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
+
+ /* return packet */
+ if (asf_st->ds_span > 1) {
+- if(asf_st->pkt.size != asf_st->ds_packet_size * asf_st->ds_span){
+- av_log(s, AV_LOG_ERROR, "pkt.size != ds_packet_size * ds_span (%d %d %d)\n", asf_st->pkt.size, asf_st->ds_packet_size, asf_st->ds_span);
+- }else{
+- /* packet descrambling */
+- uint8_t *newdata = av_malloc(asf_st->pkt.size + FF_INPUT_BUFFER_PADDING_SIZE);
+- if (newdata) {
+- int offset = 0;
+- memset(newdata + asf_st->pkt.size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+- while (offset < asf_st->pkt.size) {
+- int off = offset / asf_st->ds_chunk_size;
+- int row = off / asf_st->ds_span;
+- int col = off % asf_st->ds_span;
+- int idx = row + col * asf_st->ds_packet_size / asf_st->ds_chunk_size;
+- assert(offset + asf_st->ds_chunk_size <= asf_st->pkt.size);
+- assert(idx+1 <= asf_st->pkt.size / asf_st->ds_chunk_size);
+- memcpy(newdata + offset,
+- asf_st->pkt.data + idx * asf_st->ds_chunk_size,
+- asf_st->ds_chunk_size);
+- offset += asf_st->ds_chunk_size;
++ if(asf_st->pkt.size != asf_st->ds_packet_size * asf_st->ds_span) {
++ av_log(s, AV_LOG_ERROR, "pkt.size != ds_packet_size * "
++ "ds_span (%d %d %d)\n", asf_st->pkt.size,
++ asf_st->ds_packet_size, asf_st->ds_span);
++ } else {
++ /* packet descrambling */
++ uint8_t *newdata = av_malloc(asf_st->pkt.size + FF_INPUT_BUFFER_PADDING_SIZE);
++ if (newdata) {
++ int offset = 0;
++ memset(newdata + asf_st->pkt.size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
++ while (offset < asf_st->pkt.size) {
++ int off = offset / asf_st->ds_chunk_size;
++ int row = off / asf_st->ds_span;
++ int col = off % asf_st->ds_span;
++ int idx = row + col * asf_st->ds_packet_size / asf_st->ds_chunk_size;
++ assert(offset + asf_st->ds_chunk_size <= asf_st->pkt.size);
++ assert(idx+1 <= asf_st->pkt.size / asf_st->ds_chunk_size);
++ memcpy(newdata + offset,
++ asf_st->pkt.data + idx * asf_st->ds_chunk_size,
++ asf_st->ds_chunk_size);
++ offset += asf_st->ds_chunk_size;
++ }
++ av_free(asf_st->pkt.data);
++ asf_st->pkt.data = newdata;
+ }
+- av_free(asf_st->pkt.data);
+- asf_st->pkt.data = newdata;
+ }
+- }
+ }
+- asf_st->frag_offset = 0;
+- *pkt= asf_st->pkt;
+- asf_st->pkt.size = 0;
+- asf_st->pkt.data = 0;
++ asf_st->frag_offset = 0;
++ *pkt = asf_st->pkt;
++ asf_st->pkt.size = 0;
++ asf_st->pkt.data = 0;
+ asf_st->pkt.side_data_elems = 0;
+- asf_st->pkt.side_data = NULL;
++ asf_st->pkt.side_data = NULL;
+ break; // packet completed
+ }
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0014-smoothstreamingenc-Don-t-assume-streams-start-from-t.patch b/debian/patches/post-9beta2/0014-smoothstreamingenc-Don-t-assume-streams-start-from-t.patch
new file mode 100644
index 0000000..ee935c8
--- /dev/null
+++ b/debian/patches/post-9beta2/0014-smoothstreamingenc-Don-t-assume-streams-start-from-t.patch
@@ -0,0 +1,42 @@
+From c44cef978bd5c2692606a7a4ef4a7da393147ab0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Wed, 24 Oct 2012 01:05:12 +0300
+Subject: [PATCH 014/204] smoothstreamingenc: Don't assume streams start from
+ timestamp 0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Also use dts instead of pts for deciding where to split fragments.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavformat/smoothstreamingenc.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
+index 69d555f..1ed675a 100644
+--- a/libavformat/smoothstreamingenc.c
++++ b/libavformat/smoothstreamingenc.c
+@@ -559,12 +559,15 @@ static int ism_write_packet(AVFormatContext *s, AVPacket *pkt)
+ SmoothStreamingContext *c = s->priv_data;
+ AVStream *st = s->streams[pkt->stream_index];
+ OutputStream *os = &c->streams[pkt->stream_index];
+- int64_t end_pts = (c->nb_fragments + 1) * c->min_frag_duration;
++ int64_t end_dts = (c->nb_fragments + 1) * c->min_frag_duration;
+ int ret;
+
++ if (st->first_dts == AV_NOPTS_VALUE)
++ st->first_dts = pkt->dts;
++
+ if ((!c->has_video || st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
+- av_compare_ts(pkt->pts, st->time_base,
+- end_pts, AV_TIME_BASE_Q) >= 0 &&
++ av_compare_ts(pkt->dts - st->first_dts, st->time_base,
++ end_dts, AV_TIME_BASE_Q) >= 0 &&
+ pkt->flags & AV_PKT_FLAG_KEY && os->packets_written) {
+
+ if ((ret = ism_flush(s, 0)) < 0)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0015-configure-generalise-64-bit-test.patch b/debian/patches/post-9beta2/0015-configure-generalise-64-bit-test.patch
new file mode 100644
index 0000000..fe718c9
--- /dev/null
+++ b/debian/patches/post-9beta2/0015-configure-generalise-64-bit-test.patch
@@ -0,0 +1,40 @@
+From d4c99513f41272b9753e59642724717b834710a0 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Tue, 23 Oct 2012 23:33:44 +0100
+Subject: [PATCH 015/204] configure: generalise 64-bit test
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 37cdf1e..b1c6d45 100755
+--- a/configure
++++ b/configure
+@@ -2668,13 +2668,20 @@ EOF
+ check_host_cflags -std=c99
+ check_host_cflags -Wall
+
++check_64bit(){
++ arch32=$1
++ arch64=$2
++ expr=$3
++ check_code cc "" "int test[2*($expr) - 1]" &&
++ subarch=$arch64 || subarch=$arch32
++}
++
+ case "$arch" in
+ alpha|ia64|mips|parisc|sparc)
+ spic=$shared
+ ;;
+ x86)
+- subarch="x86_32"
+- check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
++ check_64bit x86_32 x86_64 'sizeof(void *) > 4'
+ if test "$subarch" = "x86_64"; then
+ spic=$shared
+ fi
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0016-configure-detect-mips64-automatically.patch b/debian/patches/post-9beta2/0016-configure-detect-mips64-automatically.patch
new file mode 100644
index 0000000..1fb5351
--- /dev/null
+++ b/debian/patches/post-9beta2/0016-configure-detect-mips64-automatically.patch
@@ -0,0 +1,45 @@
+From 2acda282eb8efac556cb351e91c557e580406294 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Tue, 23 Oct 2012 23:34:35 +0100
+Subject: [PATCH 016/204] configure: detect mips64 automatically
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/configure b/configure
+index b1c6d45..9f6eda5 100755
+--- a/configure
++++ b/configure
+@@ -2453,13 +2453,9 @@ case "$arch" in
+ arm*)
+ arch="arm"
+ ;;
+- mips|mipsel|IP*)
++ mips*|IP*)
+ arch="mips"
+ ;;
+- mips64*)
+- arch="mips"
+- subarch="mips64"
+- ;;
+ parisc|hppa)
+ arch="parisc"
+ ;;
+@@ -2677,7 +2673,11 @@ check_64bit(){
+ }
+
+ case "$arch" in
+- alpha|ia64|mips|parisc|sparc)
++ alpha|ia64|parisc|sparc)
++ spic=$shared
++ ;;
++ mips)
++ check_64bit mips mips64 '_MIPS_SIM > 1'
+ spic=$shared
+ ;;
+ x86)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0017-configure-detect-ppc64-automatically.patch b/debian/patches/post-9beta2/0017-configure-detect-ppc64-automatically.patch
new file mode 100644
index 0000000..c025f6b
--- /dev/null
+++ b/debian/patches/post-9beta2/0017-configure-detect-ppc64-automatically.patch
@@ -0,0 +1,42 @@
+From 56203596aea365387917c40964c03b5156b15e22 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Tue, 23 Oct 2012 23:39:40 +0100
+Subject: [PATCH 017/204] configure: detect ppc64 automatically
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/configure b/configure
+index 9f6eda5..1f48fbe 100755
+--- a/configure
++++ b/configure
+@@ -2463,13 +2463,9 @@ case "$arch" in
+ arch="parisc"
+ subarch="parisc64"
+ ;;
+- "Power Macintosh"|ppc|powerpc)
++ "Power Macintosh"|ppc*|powerpc*)
+ arch="ppc"
+ ;;
+- ppc64|powerpc64)
+- arch="ppc"
+- subarch="ppc64"
+- ;;
+ s390|s390x)
+ arch="s390"
+ ;;
+@@ -2680,6 +2676,9 @@ case "$arch" in
+ check_64bit mips mips64 '_MIPS_SIM > 1'
+ spic=$shared
+ ;;
++ ppc)
++ check_64bit ppc ppc64 'sizeof(void *) > 4'
++ ;;
+ x86)
+ check_64bit x86_32 x86_64 'sizeof(void *) > 4'
+ if test "$subarch" = "x86_64"; then
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0018-configure-detect-parisc64-automatically.patch b/debian/patches/post-9beta2/0018-configure-detect-parisc64-automatically.patch
new file mode 100644
index 0000000..6954994
--- /dev/null
+++ b/debian/patches/post-9beta2/0018-configure-detect-parisc64-automatically.patch
@@ -0,0 +1,51 @@
+From a6e9d6497739b7b60e3284f03b27883514bbc94a Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Wed, 24 Oct 2012 00:21:15 +0100
+Subject: [PATCH 018/204] configure: detect parisc64 automatically
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/configure b/configure
+index 1f48fbe..079e6db 100755
+--- a/configure
++++ b/configure
+@@ -2456,13 +2456,9 @@ case "$arch" in
+ mips*|IP*)
+ arch="mips"
+ ;;
+- parisc|hppa)
++ parisc*|hppa*)
+ arch="parisc"
+ ;;
+- parisc64|hppa64)
+- arch="parisc"
+- subarch="parisc64"
+- ;;
+ "Power Macintosh"|ppc*|powerpc*)
+ arch="ppc"
+ ;;
+@@ -2669,13 +2665,17 @@ check_64bit(){
+ }
+
+ case "$arch" in
+- alpha|ia64|parisc|sparc)
++ alpha|ia64|sparc)
+ spic=$shared
+ ;;
+ mips)
+ check_64bit mips mips64 '_MIPS_SIM > 1'
+ spic=$shared
+ ;;
++ parisc)
++ check_64bit parisc parisc64 'sizeof(void *) > 4'
++ spic=$shared
++ ;;
+ ppc)
+ check_64bit ppc ppc64 'sizeof(void *) > 4'
+ ;;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0019-avutil-Move-memcpy_backptr-to-mem.c.patch b/debian/patches/post-9beta2/0019-avutil-Move-memcpy_backptr-to-mem.c.patch
new file mode 100644
index 0000000..2269775
--- /dev/null
+++ b/debian/patches/post-9beta2/0019-avutil-Move-memcpy_backptr-to-mem.c.patch
@@ -0,0 +1,310 @@
+From 5bac2d0c3020587a03cb14e8b6a664a0b92f26c2 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Thu, 18 Oct 2012 19:27:51 +0200
+Subject: [PATCH 019/204] avutil: Move memcpy_backptr() to mem.c
+
+The function is used elsewhere and does not belong with the LZO code.
+---
+ libavcodec/dfa.c | 2 +-
+ libavcodec/eatgv.c | 2 +-
+ libavcodec/g723_1.c | 2 +-
+ libavcodec/lcldec.c | 2 +-
+ libavcodec/wmavoice.c | 2 +-
+ libavcodec/xan.c | 3 +--
+ libavcodec/xxan.c | 3 +--
+ libavutil/lzo.c | 44 +-------------------------------------------
+ libavutil/lzo.h | 11 -----------
+ libavutil/mem.c | 37 +++++++++++++++++++++++++++++++++++++
+ libavutil/mem.h | 12 ++++++++++++
+ 11 files changed, 57 insertions(+), 63 deletions(-)
+
+diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
+index ae184d7..1598f47 100644
+--- a/libavcodec/dfa.c
++++ b/libavcodec/dfa.c
+@@ -24,7 +24,7 @@
+ #include "bytestream.h"
+
+ #include "libavutil/imgutils.h"
+-#include "libavutil/lzo.h" // for av_memcpy_backptr
++#include "libavutil/mem.h"
+
+ typedef struct DfaContext {
+ AVFrame pic;
+diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
+index 404238b..170eeb1 100644
+--- a/libavcodec/eatgv.c
++++ b/libavcodec/eatgv.c
+@@ -31,8 +31,8 @@
+ #include "avcodec.h"
+ #define BITSTREAM_READER_LE
+ #include "get_bits.h"
+-#include "libavutil/lzo.h"
+ #include "libavutil/imgutils.h"
++#include "libavutil/mem.h"
+
+ #define EA_PREAMBLE_SIZE 8
+ #define kVGT_TAG MKTAG('k', 'V', 'G', 'T')
+diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
+index 5c213da..342c634 100644
+--- a/libavcodec/g723_1.c
++++ b/libavcodec/g723_1.c
+@@ -27,7 +27,7 @@
+
+ #define BITSTREAM_READER_LE
+ #include "libavutil/audioconvert.h"
+-#include "libavutil/lzo.h"
++#include "libavutil/mem.h"
+ #include "libavutil/opt.h"
+ #include "avcodec.h"
+ #include "get_bits.h"
+diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
+index 6b101ae..c80d0fe 100644
+--- a/libavcodec/lcldec.c
++++ b/libavcodec/lcldec.c
+@@ -41,10 +41,10 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+
++#include "libavutil/mem.h"
+ #include "avcodec.h"
+ #include "bytestream.h"
+ #include "lcl.h"
+-#include "libavutil/lzo.h"
+
+ #if CONFIG_ZLIB_DECODER
+ #include <zlib.h>
+diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
+index 63caad2..466d1ec 100644
+--- a/libavcodec/wmavoice.c
++++ b/libavcodec/wmavoice.c
+@@ -29,6 +29,7 @@
+
+ #include <math.h>
+
++#include "libavutil/mem.h"
+ #include "dsputil.h"
+ #include "avcodec.h"
+ #include "get_bits.h"
+@@ -38,7 +39,6 @@
+ #include "acelp_vectors.h"
+ #include "acelp_filters.h"
+ #include "lsp.h"
+-#include "libavutil/lzo.h"
+ #include "dct.h"
+ #include "rdft.h"
+ #include "sinewin.h"
+diff --git a/libavcodec/xan.c b/libavcodec/xan.c
+index 586320b..e6bfc0d 100644
+--- a/libavcodec/xan.c
++++ b/libavcodec/xan.c
+@@ -33,12 +33,11 @@
+ #include <string.h>
+
+ #include "libavutil/intreadwrite.h"
++#include "libavutil/mem.h"
+ #include "avcodec.h"
+ #include "bytestream.h"
+ #define BITSTREAM_READER_LE
+ #include "get_bits.h"
+-// for av_memcpy_backptr
+-#include "libavutil/lzo.h"
+
+ #define RUNTIME_GAMMA 0
+
+diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
+index b06d314..2a5a8ca 100644
+--- a/libavcodec/xxan.c
++++ b/libavcodec/xxan.c
+@@ -22,11 +22,10 @@
+
+ #include "avcodec.h"
+ #include "libavutil/intreadwrite.h"
++#include "libavutil/mem.h"
+ #include "bytestream.h"
+ #define BITSTREAM_READER_LE
+ #include "get_bits.h"
+-// for av_memcpy_backptr
+-#include "libavutil/lzo.h"
+
+ typedef struct XanContext {
+ AVCodecContext *avctx;
+diff --git a/libavutil/lzo.c b/libavutil/lzo.c
+index c17d32f..eff3cd2 100644
+--- a/libavutil/lzo.c
++++ b/libavutil/lzo.c
+@@ -100,8 +100,6 @@ static inline void copy(LZOContext *c, int cnt)
+ c->out = dst + cnt;
+ }
+
+-static inline void memcpy_backptr(uint8_t *dst, int back, int cnt);
+-
+ /**
+ * @brief Copies previously decoded bytes to current position.
+ * @param back how many bytes back we start
+@@ -122,50 +120,10 @@ static inline void copy_backptr(LZOContext *c, int back, int cnt)
+ cnt = FFMAX(c->out_end - dst, 0);
+ c->error |= AV_LZO_OUTPUT_FULL;
+ }
+- memcpy_backptr(dst, back, cnt);
++ av_memcpy_backptr(dst, back, cnt);
+ c->out = dst + cnt;
+ }
+
+-static inline void memcpy_backptr(uint8_t *dst, int back, int cnt)
+-{
+- const uint8_t *src = &dst[-back];
+- if (back == 1) {
+- memset(dst, *src, cnt);
+- } else {
+- if (cnt >= 4) {
+- AV_COPY16U(dst, src);
+- AV_COPY16U(dst + 2, src + 2);
+- src += 4;
+- dst += 4;
+- cnt -= 4;
+- }
+- if (cnt >= 8) {
+- AV_COPY16U(dst, src);
+- AV_COPY16U(dst + 2, src + 2);
+- AV_COPY16U(dst + 4, src + 4);
+- AV_COPY16U(dst + 6, src + 6);
+- src += 8;
+- dst += 8;
+- cnt -= 8;
+- }
+- if (cnt > 0) {
+- int blocklen = back;
+- while (cnt > blocklen) {
+- memcpy(dst, src, blocklen);
+- dst += blocklen;
+- cnt -= blocklen;
+- blocklen <<= 1;
+- }
+- memcpy(dst, src, cnt);
+- }
+- }
+-}
+-
+-void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
+-{
+- memcpy_backptr(dst, back, cnt);
+-}
+-
+ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen)
+ {
+ int state = 0;
+diff --git a/libavutil/lzo.h b/libavutil/lzo.h
+index a84b9bd..9d7e8f1 100644
+--- a/libavutil/lzo.h
++++ b/libavutil/lzo.h
+@@ -60,17 +60,6 @@
+ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
+
+ /**
+- * @brief deliberately overlapping memcpy implementation
+- * @param dst destination buffer
+- * @param back how many bytes back we start (the initial size of the overlapping window)
+- * @param cnt number of bytes to copy, must be >= 0
+- *
+- * cnt > back is valid, this will copy the bytes we just copied,
+- * thus creating a repeating pattern with a period length of back.
+- */
+-void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
+-
+-/**
+ * @}
+ */
+
+diff --git a/libavutil/mem.c b/libavutil/mem.c
+index 16c1adb..feba316 100644
+--- a/libavutil/mem.c
++++ b/libavutil/mem.c
+@@ -27,6 +27,7 @@
+ #include "config.h"
+
+ #include <limits.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #if HAVE_MALLOC_H
+@@ -34,6 +35,7 @@
+ #endif
+
+ #include "avutil.h"
++#include "intreadwrite.h"
+ #include "mem.h"
+
+ /* here we can use OS-dependent allocation functions */
+@@ -177,3 +179,38 @@ char *av_strdup(const char *s)
+ }
+ return ptr;
+ }
++
++void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
++{
++ const uint8_t *src = &dst[-back];
++ if (back == 1) {
++ memset(dst, *src, cnt);
++ } else {
++ if (cnt >= 4) {
++ AV_COPY16U(dst, src);
++ AV_COPY16U(dst + 2, src + 2);
++ src += 4;
++ dst += 4;
++ cnt -= 4;
++ }
++ if (cnt >= 8) {
++ AV_COPY16U(dst, src);
++ AV_COPY16U(dst + 2, src + 2);
++ AV_COPY16U(dst + 4, src + 4);
++ AV_COPY16U(dst + 6, src + 6);
++ src += 8;
++ dst += 8;
++ cnt -= 8;
++ }
++ if (cnt > 0) {
++ int blocklen = back;
++ while (cnt > blocklen) {
++ memcpy(dst, src, blocklen);
++ dst += blocklen;
++ cnt -= blocklen;
++ blocklen <<= 1;
++ }
++ memcpy(dst, src, cnt);
++ }
++ }
++}
+diff --git a/libavutil/mem.h b/libavutil/mem.h
+index 4f14f27..8f47224 100644
+--- a/libavutil/mem.h
++++ b/libavutil/mem.h
+@@ -27,6 +27,7 @@
+ #define AVUTIL_MEM_H
+
+ #include <limits.h>
++#include <stdint.h>
+
+ #include "attributes.h"
+ #include "avutil.h"
+@@ -165,6 +166,17 @@ char *av_strdup(const char *s) av_malloc_attrib;
+ void av_freep(void *ptr);
+
+ /**
++ * @brief deliberately overlapping memcpy implementation
++ * @param dst destination buffer
++ * @param back how many bytes back we start (the initial size of the overlapping window)
++ * @param cnt number of bytes to copy, must be >= 0
++ *
++ * cnt > back is valid, this will copy the bytes we just copied,
++ * thus creating a repeating pattern with a period length of back.
++ */
++void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
++
++/**
+ * @}
+ */
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0020-avutil-Make-LZO-decoder-code-configure-time-selectab.patch b/debian/patches/post-9beta2/0020-avutil-Make-LZO-decoder-code-configure-time-selectab.patch
new file mode 100644
index 0000000..ee3bec7
--- /dev/null
+++ b/debian/patches/post-9beta2/0020-avutil-Make-LZO-decoder-code-configure-time-selectab.patch
@@ -0,0 +1,138 @@
+From 2a91ada8282f18d2807abee5188225bba1b19bda Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Thu, 18 Oct 2012 19:48:27 +0200
+Subject: [PATCH 020/204] avutil: Make LZO decoder code configure-time
+ selectable
+
+---
+ configure | 6 +++++-
+ libavformat/matroskadec.c | 9 +++++++--
+ libavutil/Makefile | 6 ++++--
+ 3 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/configure b/configure
+index 079e6db..df07a6f 100755
+--- a/configure
++++ b/configure
+@@ -120,6 +120,7 @@ Component options:
+ --disable-dct disable DCT code
+ --disable-dwt disable DWT code
+ --disable-lsp disable LSP code
++ --disable-lzo disable LZO decoder code
+ --disable-mdct disable MDCT code
+ --disable-rdft disable RDFT code
+ --disable-fft disable FFT code
+@@ -1029,6 +1030,7 @@ CONFIG_LIST="
+ libxavs
+ libxvid
+ lsp
++ lzo
+ mdct
+ memalign_hack
+ network
+@@ -1437,6 +1439,7 @@ binkaudio_dct_decoder_select="mdct rdft dct sinewin"
+ binkaudio_rdft_decoder_select="mdct rdft sinewin"
+ cavs_decoder_select="golomb mpegvideo"
+ cook_decoder_select="mdct sinewin"
++cscd_decoder_select="lzo"
+ cscd_decoder_suggest="zlib"
+ dca_decoder_select="mdct"
+ dnxhd_encoder_select="aandcttables mpegvideoenc"
+@@ -1516,6 +1519,7 @@ msmpeg4v3_encoder_select="h263_encoder"
+ mss2_decoder_select="vc1_decoder"
+ nellymoser_decoder_select="mdct sinewin"
+ nellymoser_encoder_select="mdct sinewin"
++nuv_decoder_select="lzo"
+ png_decoder_select="zlib"
+ png_encoder_select="zlib"
+ qcelp_decoder_select="lsp"
+@@ -1628,7 +1632,7 @@ eac3_demuxer_select="ac3_parser"
+ flac_demuxer_select="flac_parser"
+ ipod_muxer_select="mov_muxer"
+ matroska_audio_muxer_select="matroska_muxer"
+-matroska_demuxer_suggest="zlib bzlib"
++matroska_demuxer_suggest="bzlib lzo zlib"
+ mov_demuxer_suggest="zlib"
+ mp3_demuxer_select="mpegaudio_parser"
+ mp4_muxer_select="mov_muxer"
+diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
+index 68c936c..26f8707 100644
+--- a/libavformat/matroskadec.c
++++ b/libavformat/matroskadec.c
+@@ -1011,6 +1011,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
+ memcpy(pkt_data + header_size, data, isize);
+ break;
+ }
++#if CONFIG_LZO
+ case MATROSKA_TRACK_ENCODING_COMP_LZO:
+ do {
+ olen = pkt_size *= 3;
+@@ -1028,6 +1029,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
+ }
+ pkt_size -= olen;
+ break;
++#endif
+ #if CONFIG_ZLIB
+ case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
+ z_stream zstream = {0};
+@@ -1436,14 +1438,17 @@ static int matroska_read_header(AVFormatContext *s)
+ "Multiple combined encodings not supported");
+ } else if (encodings_list->nb_elem == 1) {
+ if (encodings[0].type ||
+- (encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP &&
++ (
+ #if CONFIG_ZLIB
+ encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_ZLIB &&
+ #endif
+ #if CONFIG_BZLIB
+ encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_BZLIB &&
+ #endif
+- encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_LZO)) {
++#if CONFIG_LZO
++ encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_LZO &&
++#endif
++ encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP)) {
+ encodings[0].scope = 0;
+ av_log(matroska->ctx, AV_LOG_ERROR,
+ "Unsupported encoding type");
+diff --git a/libavutil/Makefile b/libavutil/Makefile
+index 227a57e..45f8e90 100644
+--- a/libavutil/Makefile
++++ b/libavutil/Makefile
+@@ -24,7 +24,6 @@ HEADERS = adler32.h \
+ intreadwrite.h \
+ lfg.h \
+ log.h \
+- lzo.h \
+ mathematics.h \
+ md5.h \
+ mem.h \
+@@ -42,6 +41,8 @@ HEADERS = adler32.h \
+ version.h \
+ xtea.h \
+
++HEADERS-$(CONFIG_LZO) += lzo.h
++
+ ARCH_HEADERS = bswap.h \
+ intmath.h \
+ intreadwrite.h \
+@@ -71,7 +72,6 @@ OBJS = adler32.o \
+ log.o \
+ log2.o \
+ log2_tab.o \
+- lzo.o \
+ mathematics.o \
+ md5.o \
+ mem.o \
+@@ -89,6 +89,8 @@ OBJS = adler32.o \
+ utils.o \
+ xtea.o \
+
++OBJS-$(CONFIG_LZO) += lzo.o
++
+ OBJS += $(COMPAT_OBJS:%=../compat/%)
+
+ SKIPHEADERS = old_pix_fmts.h
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0021-rawvideo-use-a-specific-read_header.patch b/debian/patches/post-9beta2/0021-rawvideo-use-a-specific-read_header.patch
new file mode 100644
index 0000000..d556aed
--- /dev/null
+++ b/debian/patches/post-9beta2/0021-rawvideo-use-a-specific-read_header.patch
@@ -0,0 +1,128 @@
+From 42c26a4864f1cefa4175c6c171aa0e4bd88dd42d Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Wed, 24 Oct 2012 14:18:49 +0200
+Subject: [PATCH 021/204] rawvideo: use a specific read_header
+
+ff_raw_read_header is used only for this demuxer for video.
+---
+ libavformat/Makefile | 2 +-
+ libavformat/rawvideodec.c | 68 ++++++++++++++++++++++++++++++++++++++++-----
+ 2 files changed, 62 insertions(+), 8 deletions(-)
+
+diff --git a/libavformat/Makefile b/libavformat/Makefile
+index 2d66a6d..a285af1 100644
+--- a/libavformat/Makefile
++++ b/libavformat/Makefile
+@@ -239,7 +239,7 @@ OBJS-$(CONFIG_PMP_DEMUXER) += pmpdec.o
+ OBJS-$(CONFIG_PVA_DEMUXER) += pva.o
+ OBJS-$(CONFIG_QCP_DEMUXER) += qcp.o
+ OBJS-$(CONFIG_R3D_DEMUXER) += r3d.o
+-OBJS-$(CONFIG_RAWVIDEO_DEMUXER) += rawvideodec.o rawdec.o
++OBJS-$(CONFIG_RAWVIDEO_DEMUXER) += rawvideodec.o
+ OBJS-$(CONFIG_RAWVIDEO_MUXER) += rawenc.o
+ OBJS-$(CONFIG_RL2_DEMUXER) += rl2.o
+ OBJS-$(CONFIG_RM_DEMUXER) += rmdec.o rm.o rmsipr.o
+diff --git a/libavformat/rawvideodec.c b/libavformat/rawvideodec.c
+index f71ea0a..5f372c9 100644
+--- a/libavformat/rawvideodec.c
++++ b/libavformat/rawvideodec.c
+@@ -19,8 +19,63 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include "libavutil/parseutils.h"
++#include "libavutil/pixdesc.h"
++#include "libavutil/opt.h"
++#include "internal.h"
+ #include "avformat.h"
+-#include "rawdec.h"
++
++typedef struct RawVideoDemuxerContext {
++ const AVClass *class; /**< Class for private options. */
++ char *video_size; /**< String describing video size, set by a private option. */
++ char *pixel_format; /**< Set by a private option. */
++ char *framerate; /**< String describing framerate, set by a private option. */
++} RawVideoDemuxerContext;
++
++
++static int rawvideo_read_header(AVFormatContext *ctx)
++{
++ RawVideoDemuxerContext *s = ctx->priv_data;
++ int width = 0, height = 0, ret = 0;
++ enum AVPixelFormat pix_fmt;
++ AVRational framerate;
++ AVStream *st;
++
++ st = avformat_new_stream(ctx, NULL);
++ if (!st)
++ return AVERROR(ENOMEM);
++
++ st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
++
++ st->codec->codec_id = ctx->iformat->raw_codec_id;
++
++ if (s->video_size &&
++ (ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
++ av_log(ctx, AV_LOG_ERROR, "Couldn't parse video size.\n");
++ return ret;
++ }
++
++ if ((pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
++ av_log(ctx, AV_LOG_ERROR, "No such pixel format: %s.\n",
++ s->pixel_format);
++ return AVERROR(EINVAL);
++ }
++
++ if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
++ av_log(ctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n",
++ s->framerate);
++ return ret;
++ }
++
++ avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
++
++ st->codec->width = width;
++ st->codec->height = height;
++ st->codec->pix_fmt = pix_fmt;
++
++ return 0;
++}
++
+
+ static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
+ {
+@@ -34,9 +89,8 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
+ if (packet_size < 0)
+ return -1;
+
+- ret= av_get_packet(s->pb, pkt, packet_size);
+- pkt->pts=
+- pkt->dts= pkt->pos / packet_size;
++ ret = av_get_packet(s->pb, pkt, packet_size);
++ pkt->pts = pkt->dts = pkt->pos / packet_size;
+
+ pkt->stream_index = 0;
+ if (ret < 0)
+@@ -44,7 +98,7 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
+ return 0;
+ }
+
+-#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
++#define OFFSET(x) offsetof(RawVideoDemuxerContext, x)
+ #define DEC AV_OPT_FLAG_DECODING_PARAM
+ static const AVOption rawvideo_options[] = {
+ { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
+@@ -63,8 +117,8 @@ static const AVClass rawvideo_demuxer_class = {
+ AVInputFormat ff_rawvideo_demuxer = {
+ .name = "rawvideo",
+ .long_name = NULL_IF_CONFIG_SMALL("raw video"),
+- .priv_data_size = sizeof(FFRawVideoDemuxerContext),
+- .read_header = ff_raw_read_header,
++ .priv_data_size = sizeof(RawVideoDemuxerContext),
++ .read_header = rawvideo_read_header,
+ .read_packet = rawvideo_read_packet,
+ .flags = AVFMT_GENERIC_INDEX,
+ .extensions = "yuv,cif,qcif,rgb",
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0022-g722-refactor-out-of-rawdec.c.patch b/debian/patches/post-9beta2/0022-g722-refactor-out-of-rawdec.c.patch
new file mode 100644
index 0000000..1e7e690
--- /dev/null
+++ b/debian/patches/post-9beta2/0022-g722-refactor-out-of-rawdec.c.patch
@@ -0,0 +1,113 @@
+From 5f0e161dd61552ad70760bad35b869eaec7368ff Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Wed, 24 Oct 2012 18:18:18 +0200
+Subject: [PATCH 022/204] g722: refactor out of rawdec.c
+
+---
+ libavformat/Makefile | 2 +-
+ libavformat/g722.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ libavformat/rawdec.c | 12 -----------
+ 3 files changed, 57 insertions(+), 13 deletions(-)
+ create mode 100644 libavformat/g722.c
+
+diff --git a/libavformat/Makefile b/libavformat/Makefile
+index a285af1..832ea41 100644
+--- a/libavformat/Makefile
++++ b/libavformat/Makefile
+@@ -101,7 +101,7 @@ OBJS-$(CONFIG_GIF_MUXER) += gif.o
+ OBJS-$(CONFIG_GSM_DEMUXER) += gsmdec.o
+ OBJS-$(CONFIG_GXF_DEMUXER) += gxf.o
+ OBJS-$(CONFIG_GXF_MUXER) += gxfenc.o audiointerleave.o
+-OBJS-$(CONFIG_G722_DEMUXER) += rawdec.o
++OBJS-$(CONFIG_G722_DEMUXER) += g722.o rawdec.o
+ OBJS-$(CONFIG_G722_MUXER) += rawenc.o
+ OBJS-$(CONFIG_G723_1_DEMUXER) += g723_1.o
+ OBJS-$(CONFIG_H261_DEMUXER) += h261dec.o rawdec.o
+diff --git a/libavformat/g722.c b/libavformat/g722.c
+new file mode 100644
+index 0000000..8052939
+--- /dev/null
++++ b/libavformat/g722.c
+@@ -0,0 +1,56 @@
++/*
++ * g722 raw demuxer
++ * Copyright (c) 2010 Martin Storsjo
++ *
++ * This file is part of Libav.
++ *
++ * Libav is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * Libav is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with Libav; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#include "avformat.h"
++#include "internal.h"
++#include "rawdec.h"
++
++static int g722_read_header(AVFormatContext *s)
++{
++ AVStream *st;
++
++ st = avformat_new_stream(s, NULL);
++ if (!st)
++ return AVERROR(ENOMEM);
++
++ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
++ st->codec->codec_id = AV_CODEC_ID_ADPCM_G722;
++ st->codec->sample_rate = 16000;
++ st->codec->channels = 1;
++
++ st->codec->bits_per_coded_sample =
++ av_get_bits_per_sample(st->codec->codec_id);
++
++ assert(st->codec->bits_per_coded_sample > 0);
++
++ avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
++ return 0;
++}
++
++AVInputFormat ff_g722_demuxer = {
++ .name = "g722",
++ .long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
++ .read_header = g722_read_header,
++ .read_packet = ff_raw_read_partial_packet,
++ .flags = AVFMT_GENERIC_INDEX,
++ .extensions = "g722,722",
++ .raw_codec_id = AV_CODEC_ID_ADPCM_G722,
++};
+diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
+index 7ea3d2b..fd1e9b9 100644
+--- a/libavformat/rawdec.c
++++ b/libavformat/rawdec.c
+@@ -177,18 +177,6 @@ const AVOption ff_rawvideo_options[] = {
+ { NULL },
+ };
+
+-#if CONFIG_G722_DEMUXER
+-AVInputFormat ff_g722_demuxer = {
+- .name = "g722",
+- .long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
+- .read_header = ff_raw_read_header,
+- .read_packet = ff_raw_read_partial_packet,
+- .flags = AVFMT_GENERIC_INDEX,
+- .extensions = "g722,722",
+- .raw_codec_id = AV_CODEC_ID_ADPCM_G722,
+-};
+-#endif
+-
+ #if CONFIG_LATM_DEMUXER
+ AVInputFormat ff_latm_demuxer = {
+ .name = "latm",
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0023-pcmdec-remove-dependency-from-rawdec.patch b/debian/patches/post-9beta2/0023-pcmdec-remove-dependency-from-rawdec.patch
new file mode 100644
index 0000000..eadca37
--- /dev/null
+++ b/debian/patches/post-9beta2/0023-pcmdec-remove-dependency-from-rawdec.patch
@@ -0,0 +1,145 @@
+From 2ef4d586d6352a69c0669d53ce1035eb7d8db0e8 Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Wed, 24 Oct 2012 19:15:50 +0200
+Subject: [PATCH 023/204] pcmdec: remove dependency from rawdec
+
+The code shared is not actually shared with anything else.
+---
+ libavformat/Makefile | 40 ++++++++++++++++++++--------------------
+ libavformat/pcmdec.c | 37 +++++++++++++++++++++++++++++++++++--
+ 2 files changed, 55 insertions(+), 22 deletions(-)
+
+diff --git a/libavformat/Makefile b/libavformat/Makefile
+index 832ea41..acf0500 100644
+--- a/libavformat/Makefile
++++ b/libavformat/Makefile
+@@ -195,45 +195,45 @@ OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \
+ vorbiscomment.o
+ OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o oma.o
+ OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o oma.o id3v2enc.o
+-OBJS-$(CONFIG_PCM_ALAW_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_ALAW_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_ALAW_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_F32BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_F32BE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_F32BE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_F32LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_F32LE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_F32LE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_F64BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_F64BE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_F64BE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_F64LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_F64LE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_F64LE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_MULAW_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_MULAW_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_MULAW_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_S16BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_S16BE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_S16BE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_S16LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_S16LE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_S16LE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_S24BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_S24BE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_S24BE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_S24LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_S24LE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_S24LE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_S32BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_S32BE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_S32BE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_S32LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_S32LE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_S32LE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_S8_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_S8_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_S8_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_U16BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_U16BE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_U16BE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_U16LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_U16LE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_U16LE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_U24BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_U24BE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_U24BE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_U24LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_U24LE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_U24LE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_U32BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_U32BE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_U32BE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_U32LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_U32LE_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_U32LE_MUXER) += pcmenc.o rawenc.o
+-OBJS-$(CONFIG_PCM_U8_DEMUXER) += pcmdec.o pcm.o rawdec.o
++OBJS-$(CONFIG_PCM_U8_DEMUXER) += pcmdec.o pcm.o
+ OBJS-$(CONFIG_PCM_U8_MUXER) += pcmenc.o rawenc.o
+ OBJS-$(CONFIG_PMP_DEMUXER) += pmpdec.o
+ OBJS-$(CONFIG_PVA_DEMUXER) += pva.o
+diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
+index ad47885..40446c2 100644
+--- a/libavformat/pcmdec.c
++++ b/libavformat/pcmdec.c
+@@ -20,13 +20,46 @@
+ */
+
+ #include "avformat.h"
+-#include "rawdec.h"
++#include "internal.h"
+ #include "pcm.h"
+ #include "libavutil/log.h"
+ #include "libavutil/opt.h"
+
+ #define RAW_SAMPLES 1024
+
++typedef struct RawAudioDemuxerContext {
++ AVClass *class;
++ int sample_rate;
++ int channels;
++} RawAudioDemuxerContext;
++
++static int raw_read_header(AVFormatContext *s)
++{
++ RawAudioDemuxerContext *s1 = s->priv_data;
++ AVStream *st;
++
++ st = avformat_new_stream(s, NULL);
++ if (!st)
++ return AVERROR(ENOMEM);
++
++
++ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
++ st->codec->codec_id = s->iformat->raw_codec_id;
++ st->codec->sample_rate = s1->sample_rate;
++ st->codec->channels = s1->channels;
++
++ st->codec->bits_per_coded_sample =
++ av_get_bits_per_sample(st->codec->codec_id);
++
++ assert(st->codec->bits_per_coded_sample > 0);
++
++ st->codec->block_align =
++ st->codec->bits_per_coded_sample * st->codec->channels / 8;
++
++ avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
++ return 0;
++}
++
+ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
+ {
+ int ret, size, bps;
+@@ -65,7 +98,7 @@ AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
+ .name = #name_, \
+ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
+ .priv_data_size = sizeof(RawAudioDemuxerContext), \
+- .read_header = ff_raw_read_header, \
++ .read_header = raw_read_header, \
+ .read_packet = raw_read_packet, \
+ .read_seek = ff_pcm_read_seek, \
+ .flags = AVFMT_GENERIC_INDEX, \
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0024-rawdec-remove-ff_raw_read_header.patch b/debian/patches/post-9beta2/0024-rawdec-remove-ff_raw_read_header.patch
new file mode 100644
index 0000000..abf2af7
--- /dev/null
+++ b/debian/patches/post-9beta2/0024-rawdec-remove-ff_raw_read_header.patch
@@ -0,0 +1,121 @@
+From 587874ef1c94a9b863d2f2db0e5d341e086ee232 Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Wed, 24 Oct 2012 19:53:32 +0200
+Subject: [PATCH 024/204] rawdec: remove ff_raw_read_header
+
+It is not used anymore and is a kludge.
+---
+ libavformat/rawdec.c | 70 --------------------------------------------------
+ libavformat/rawdec.h | 8 ------
+ 2 files changed, 78 deletions(-)
+
+diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
+index fd1e9b9..1c9aabd 100644
+--- a/libavformat/rawdec.c
++++ b/libavformat/rawdec.c
+@@ -28,76 +28,6 @@
+ #include "libavutil/parseutils.h"
+ #include "libavutil/pixdesc.h"
+
+-/* raw input */
+-int ff_raw_read_header(AVFormatContext *s)
+-{
+- AVStream *st;
+- enum AVCodecID id;
+-
+- st = avformat_new_stream(s, NULL);
+- if (!st)
+- return AVERROR(ENOMEM);
+-
+- id = s->iformat->raw_codec_id;
+- if (id == AV_CODEC_ID_RAWVIDEO) {
+- st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+- } else {
+- st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+- }
+- st->codec->codec_id = id;
+-
+- switch(st->codec->codec_type) {
+- case AVMEDIA_TYPE_AUDIO: {
+- RawAudioDemuxerContext *s1 = s->priv_data;
+-
+- st->codec->channels = 1;
+-
+- if (id == AV_CODEC_ID_ADPCM_G722)
+- st->codec->sample_rate = 16000;
+-
+- if (s1 && s1->sample_rate)
+- st->codec->sample_rate = s1->sample_rate;
+- if (s1 && s1->channels)
+- st->codec->channels = s1->channels;
+-
+- st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
+- assert(st->codec->bits_per_coded_sample > 0);
+- st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8;
+- avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
+- break;
+- }
+- case AVMEDIA_TYPE_VIDEO: {
+- FFRawVideoDemuxerContext *s1 = s->priv_data;
+- int width = 0, height = 0, ret = 0;
+- enum AVPixelFormat pix_fmt;
+- AVRational framerate;
+-
+- if (s1->video_size && (ret = av_parse_video_size(&width, &height, s1->video_size)) < 0) {
+- av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");
+- goto fail;
+- }
+- if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == AV_PIX_FMT_NONE) {
+- av_log(s, AV_LOG_ERROR, "No such pixel format: %s.\n", s1->pixel_format);
+- ret = AVERROR(EINVAL);
+- goto fail;
+- }
+- if ((ret = av_parse_video_rate(&framerate, s1->framerate)) < 0) {
+- av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate);
+- goto fail;
+- }
+- avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
+- st->codec->width = width;
+- st->codec->height = height;
+- st->codec->pix_fmt = pix_fmt;
+-fail:
+- return ret;
+- }
+- default:
+- return -1;
+- }
+- return 0;
+-}
+-
+ #define RAW_PACKET_SIZE 1024
+
+ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
+diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h
+index 4cce2cf..a548778 100644
+--- a/libavformat/rawdec.h
++++ b/libavformat/rawdec.h
+@@ -26,12 +26,6 @@
+ #include "libavutil/log.h"
+ #include "libavutil/opt.h"
+
+-typedef struct RawAudioDemuxerContext {
+- AVClass *class;
+- int sample_rate;
+- int channels;
+-} RawAudioDemuxerContext;
+-
+ typedef struct FFRawVideoDemuxerContext {
+ const AVClass *class; /**< Class for private options. */
+ char *video_size; /**< String describing video size, set by a private option. */
+@@ -41,8 +35,6 @@ typedef struct FFRawVideoDemuxerContext {
+
+ extern const AVOption ff_rawvideo_options[];
+
+-int ff_raw_read_header(AVFormatContext *s);
+-
+ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
+
+ int ff_raw_audio_read_header(AVFormatContext *s);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0025-avfilter-fix-graphparser-memleaks-on-error-paths.patch b/debian/patches/post-9beta2/0025-avfilter-fix-graphparser-memleaks-on-error-paths.patch
new file mode 100644
index 0000000..5be5fa0
--- /dev/null
+++ b/debian/patches/post-9beta2/0025-avfilter-fix-graphparser-memleaks-on-error-paths.patch
@@ -0,0 +1,77 @@
+From 285b706b551b94e18f875ed01163926c8b98e68b Mon Sep 17 00:00:00 2001
+From: Janne Grunau <janne-libav at jannau.net>
+Date: Tue, 9 Oct 2012 21:28:32 +0200
+Subject: [PATCH 025/204] avfilter: fix graphparser memleaks on error paths
+
+Fixes CID700635, CID700636 and CID732274.
+---
+ libavfilter/graphparser.c | 24 +++++++++++++++---------
+ 1 file changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
+index 3921189..04339c8 100644
+--- a/libavfilter/graphparser.c
++++ b/libavfilter/graphparser.c
+@@ -238,10 +238,11 @@ static int link_filter_inouts(AVFilterContext *filt_ctx,
+ return AVERROR(ENOMEM);
+
+ if (p->filter_ctx) {
+- if ((ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx)) < 0)
+- return ret;
++ ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx);
+ av_free(p->name);
+ av_free(p);
++ if (ret < 0)
++ return ret;
+ } else {
+ p->filter_ctx = filt_ctx;
+ p->pad_idx = pad;
+@@ -289,8 +290,10 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs,
+ av_free(name);
+ } else {
+ /* Not in the list, so add it as an input */
+- if (!(match = av_mallocz(sizeof(AVFilterInOut))))
++ if (!(match = av_mallocz(sizeof(AVFilterInOut)))) {
++ av_free(name);
+ return AVERROR(ENOMEM);
++ }
+ match->name = name;
+ match->pad_idx = pad;
+ }
+@@ -318,24 +321,27 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
+ AVFilterInOut *match;
+
+ AVFilterInOut *input = *curr_inputs;
++
++ if (!name)
++ return AVERROR(EINVAL);
++
+ if (!input) {
+ av_log(log_ctx, AV_LOG_ERROR,
+- "No output pad can be associated to link label '%s'.\n",
+- name);
++ "No output pad can be associated to link label '%s'.\n", name);
++ av_free(name);
+ return AVERROR(EINVAL);
+ }
+ *curr_inputs = (*curr_inputs)->next;
+
+- if (!name)
+- return AVERROR(EINVAL);
+-
+ /* First check if the label is not in the open_inputs list */
+ match = extract_inout(name, open_inputs);
+
+ if (match) {
+ if ((ret = link_filter(input->filter_ctx, input->pad_idx,
+- match->filter_ctx, match->pad_idx, log_ctx)) < 0)
++ match->filter_ctx, match->pad_idx, log_ctx)) < 0) {
++ av_free(name);
+ return ret;
++ }
+ av_free(match->name);
+ av_free(name);
+ av_free(match);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0026-avconv-fix-bitrate-report-when-writing-to-dev-null.patch b/debian/patches/post-9beta2/0026-avconv-fix-bitrate-report-when-writing-to-dev-null.patch
new file mode 100644
index 0000000..cb505a4
--- /dev/null
+++ b/debian/patches/post-9beta2/0026-avconv-fix-bitrate-report-when-writing-to-dev-null.patch
@@ -0,0 +1,37 @@
+From 1b891d17c531e8a63c2974aab4bf997ce70746f3 Mon Sep 17 00:00:00 2001
+From: Janne Grunau <janne-libav at jannau.net>
+Date: Tue, 9 Oct 2012 23:22:49 +0200
+Subject: [PATCH 026/204] avconv: fix bitrate report when writing to /dev/null
+
+avio_size() reports the filesize which returns 0 for /dev/null.
+avio_tell() reports the current position.
+
+Also handle errors from avio_tell().
+---
+ avconv.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/avconv.c b/avconv.c
+index bf1e2fa..54a0e2a 100644
+--- a/avconv.c
++++ b/avconv.c
+@@ -807,8 +807,15 @@ static void print_report(int is_last_report, int64_t timer_start)
+ oc = output_files[0]->ctx;
+
+ total_size = avio_size(oc->pb);
+- if (total_size < 0) // FIXME improve avio_size() so it works with non seekable output too
++ if (total_size <= 0) // FIXME improve avio_size() so it works with non seekable output too
+ total_size = avio_tell(oc->pb);
++ if (total_size < 0) {
++ char errbuf[128];
++ av_strerror(total_size, errbuf, sizeof(errbuf));
++ av_log(NULL, AV_LOG_VERBOSE, "Bitrate not available, "
++ "avio_tell() failed: %s\n", errbuf);
++ total_size = 0;
++ }
+
+ buf[0] = '\0';
+ ti1 = 1e10;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0027-pcmdec-change-default-of-channels-parameter-to-1.patch b/debian/patches/post-9beta2/0027-pcmdec-change-default-of-channels-parameter-to-1.patch
new file mode 100644
index 0000000..f5f1a09
--- /dev/null
+++ b/debian/patches/post-9beta2/0027-pcmdec-change-default-of-channels-parameter-to-1.patch
@@ -0,0 +1,27 @@
+From dcdfb8ede3580cde6acc1c6ca889ad3b610d75dc Mon Sep 17 00:00:00 2001
+From: Janne Grunau <janne-libav at jannau.net>
+Date: Thu, 25 Oct 2012 15:10:22 +0200
+Subject: [PATCH 027/204] pcmdec: change default of channels parameter to 1
+
+This was previously implicitly done in ff_raw_read_header().
+Fixes fate tests with pcm input.
+---
+ libavformat/pcmdec.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
+index 40446c2..de6f13e 100644
+--- a/libavformat/pcmdec.c
++++ b/libavformat/pcmdec.c
+@@ -83,7 +83,7 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
+
+ static const AVOption pcm_options[] = {
+ { "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+- { "channels", "", offsetof(RawAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
++ { "channels", "", offsetof(RawAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+ { NULL },
+ };
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0028-ffv1-set-the-range-coder-state-in-decode_slice_heade.patch b/debian/patches/post-9beta2/0028-ffv1-set-the-range-coder-state-in-decode_slice_heade.patch
new file mode 100644
index 0000000..31de0d3
--- /dev/null
+++ b/debian/patches/post-9beta2/0028-ffv1-set-the-range-coder-state-in-decode_slice_heade.patch
@@ -0,0 +1,31 @@
+From 22f7942fe7d7349e3562ac68fa101d9efec522df Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Thu, 25 Oct 2012 15:42:08 +0200
+Subject: [PATCH 028/204] ffv1: set the range coder state in
+ decode_slice_header
+
+---
+ libavcodec/ffv1dec.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
+index f5f7a8f..c5329b4 100644
+--- a/libavcodec/ffv1dec.c
++++ b/libavcodec/ffv1dec.c
+@@ -273,7 +273,12 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
+ unsigned ps, i, context_count;
+ memset(state, 128, sizeof(state));
+
+- av_assert0(f->version > 2);
++ if (fs->ac > 1) {
++ for (i = 1; i < 256; i++) {
++ fs->c.one_state[i] = f->state_transition[i];
++ fs->c.zero_state[256 - i] = 256 - fs->c.one_state[i];
++ }
++ }
+
+ fs->slice_x = get_symbol(c, state, 0) * f->width;
+ fs->slice_y = get_symbol(c, state, 0) * f->height;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0029-pcm-change-references-to-raw-to-pcm.patch b/debian/patches/post-9beta2/0029-pcm-change-references-to-raw-to-pcm.patch
new file mode 100644
index 0000000..93fcbdc
--- /dev/null
+++ b/debian/patches/post-9beta2/0029-pcm-change-references-to-raw-to-pcm.patch
@@ -0,0 +1,69 @@
+From 254056c4ab6161d687caf8e9b837571db76e60c6 Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Mon, 1 Jan 2001 01:08:20 +0100
+Subject: [PATCH 029/204] pcm: change references to raw to pcm
+
+---
+ libavformat/pcmdec.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
+index de6f13e..716d8b7 100644
+--- a/libavformat/pcmdec.c
++++ b/libavformat/pcmdec.c
+@@ -27,15 +27,15 @@
+
+ #define RAW_SAMPLES 1024
+
+-typedef struct RawAudioDemuxerContext {
++typedef struct PCMAudioDemuxerContext {
+ AVClass *class;
+ int sample_rate;
+ int channels;
+-} RawAudioDemuxerContext;
++} PCMAudioDemuxerContext;
+
+-static int raw_read_header(AVFormatContext *s)
++static int pcm_read_header(AVFormatContext *s)
+ {
+- RawAudioDemuxerContext *s1 = s->priv_data;
++ PCMAudioDemuxerContext *s1 = s->priv_data;
+ AVStream *st;
+
+ st = avformat_new_stream(s, NULL);
+@@ -60,7 +60,7 @@ static int raw_read_header(AVFormatContext *s)
+ return 0;
+ }
+
+-static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
++static int pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
+ {
+ int ret, size, bps;
+ // AVStream *st = s->streams[0];
+@@ -82,8 +82,8 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
+ }
+
+ static const AVOption pcm_options[] = {
+- { "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+- { "channels", "", offsetof(RawAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
++ { "sample_rate", "", offsetof(PCMAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
++ { "channels", "", offsetof(PCMAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+ { NULL },
+ };
+
+@@ -97,9 +97,9 @@ static const AVClass name_ ## _demuxer_class = { \
+ AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
+ .name = #name_, \
+ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
+- .priv_data_size = sizeof(RawAudioDemuxerContext), \
+- .read_header = raw_read_header, \
+- .read_packet = raw_read_packet, \
++ .priv_data_size = sizeof(PCMAudioDemuxerContext), \
++ .read_header = pcm_read_header, \
++ .read_packet = pcm_read_packet, \
+ .read_seek = ff_pcm_read_seek, \
+ .flags = AVFMT_GENERIC_INDEX, \
+ .extensions = ext, \
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0030-build-Include-HEADERS-yes-in-the-HEADERS-variable.patch b/debian/patches/post-9beta2/0030-build-Include-HEADERS-yes-in-the-HEADERS-variable.patch
new file mode 100644
index 0000000..35f4f1a
--- /dev/null
+++ b/debian/patches/post-9beta2/0030-build-Include-HEADERS-yes-in-the-HEADERS-variable.patch
@@ -0,0 +1,45 @@
+From 121604b024cfd04644a9aa6012bd0e9a48efbd9f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Thu, 25 Oct 2012 17:13:06 +0300
+Subject: [PATCH 030/204] build: Include HEADERS-yes in the HEADERS variable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This makes sure the previously always installed public header
+lzo.h is installed if the LZO functionality is enabled.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ Makefile | 2 +-
+ common.mak | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 07df538..1f73a0a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -102,7 +102,7 @@ config.h: .config
+ @-tput sgr0 2>/dev/null
+
+ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
+- ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
++ HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
+ ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS \
+ ALTIVEC-OBJS VIS-OBJS \
+ MMX-OBJS YASM-OBJS \
+diff --git a/common.mak b/common.mak
+index dd9f4cb..c4d2999 100644
+--- a/common.mak
++++ b/common.mak
+@@ -23,6 +23,7 @@ HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
+ TOOLS += $(TOOLS-yes)
+ TOOLOBJS := $(TOOLS:%=tools/%.o)
+ TOOLS := $(TOOLS:%=tools/%$(EXESUF))
++HEADERS += $(HEADERS-yes)
+
+ DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0031-configure-recognise-more-sparc-variants-as-cpu-argum.patch b/debian/patches/post-9beta2/0031-configure-recognise-more-sparc-variants-as-cpu-argum.patch
new file mode 100644
index 0000000..74f7604
--- /dev/null
+++ b/debian/patches/post-9beta2/0031-configure-recognise-more-sparc-variants-as-cpu-argum.patch
@@ -0,0 +1,34 @@
+From eadfb0560a2f194fbc453bcb22fea73f3c9a27ad Mon Sep 17 00:00:00 2001
+From: Michael Kostylev <michael.kostylev at gmail.com>
+Date: Thu, 25 Oct 2012 11:38:51 +0100
+Subject: [PATCH 031/204] configure: recognise more sparc variants as --cpu
+ argument
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure b/configure
+index df07a6f..a39cb77 100755
+--- a/configure
++++ b/configure
+@@ -2568,12 +2568,12 @@ elif enabled x86; then
+ elif enabled sparc; then
+
+ case $cpu in
+- niagara)
++ cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
+ cpuflags="-mcpu=$cpu"
+ disable vis
+ ;;
+- sparc64)
+- cpuflags="-mcpu=v9"
++ ultrasparc*|niagara[234])
++ cpuflags="-mcpu=$cpu"
+ ;;
+ esac
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0032-configure-sanitise-sparc-vis-check.patch b/debian/patches/post-9beta2/0032-configure-sanitise-sparc-vis-check.patch
new file mode 100644
index 0000000..7a47be7
--- /dev/null
+++ b/debian/patches/post-9beta2/0032-configure-sanitise-sparc-vis-check.patch
@@ -0,0 +1,30 @@
+From 6aa93689abe8c095cec9fa828c2dee3131008995 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Thu, 25 Oct 2012 15:56:16 +0100
+Subject: [PATCH 032/204] configure: sanitise sparc vis check
+
+It is wrong to force -mcpu=ultrasparc when checking for vis.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/configure b/configure
+index a39cb77..bfa3a61 100755
+--- a/configure
++++ b/configure
+@@ -3100,9 +3100,7 @@ EOF
+
+ elif enabled sparc; then
+
+- enabled vis &&
+- check_inline_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
+- add_cflags -mcpu=ultrasparc -mtune=ultrasparc
++ enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"'
+
+ elif enabled x86; then
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0033-h263-avoid-memcpys-over-array-bound-in-motion-vector.patch b/debian/patches/post-9beta2/0033-h263-avoid-memcpys-over-array-bound-in-motion-vector.patch
new file mode 100644
index 0000000..1d2aa52
--- /dev/null
+++ b/debian/patches/post-9beta2/0033-h263-avoid-memcpys-over-array-bound-in-motion-vector.patch
@@ -0,0 +1,77 @@
+From 154ff81870ce9838eaa87b19d0f5ecceb9dd514e Mon Sep 17 00:00:00 2001
+From: Janne Grunau <janne-libav at jannau.net>
+Date: Wed, 10 Oct 2012 14:25:44 +0200
+Subject: [PATCH 033/204] h263: avoid memcpys over array bound in motion
+ vector caching for obmc
+
+Fixes CID602232.
+---
+ libavcodec/mpegvideo_motion.c | 34 +++++++++++++++++++++-------------
+ 1 file changed, 21 insertions(+), 13 deletions(-)
+
+diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
+index 22948e2..9168793 100644
+--- a/libavcodec/mpegvideo_motion.c
++++ b/libavcodec/mpegvideo_motion.c
+@@ -638,37 +638,45 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
+ prefetch_motion(s, ref_picture, dir);
+
+ if(!is_mpeg12 && s->obmc && s->pict_type != AV_PICTURE_TYPE_B){
+- int16_t mv_cache[4][4][2];
++ LOCAL_ALIGNED_8(int16_t, mv_cache, [4], [4][2]);
++ AVFrame *cur_frame = &s->current_picture.f;
+ const int xy= s->mb_x + s->mb_y*s->mb_stride;
+ const int mot_stride= s->b8_stride;
+ const int mot_xy= mb_x*2 + mb_y*2*mot_stride;
+
+ assert(!s->mb_skipped);
+
+- memcpy(mv_cache[1][1], s->current_picture.f.motion_val[0][mot_xy ], sizeof(int16_t) * 4);
+- memcpy(mv_cache[2][1], s->current_picture.f.motion_val[0][mot_xy + mot_stride], sizeof(int16_t) * 4);
+- memcpy(mv_cache[3][1], s->current_picture.f.motion_val[0][mot_xy + mot_stride], sizeof(int16_t) * 4);
++ AV_COPY32(mv_cache[1][1], cur_frame->motion_val[0][mot_xy ]);
++ AV_COPY32(mv_cache[1][2], cur_frame->motion_val[0][mot_xy + 1]);
+
+- if (mb_y == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - s->mb_stride])) {
+- memcpy(mv_cache[0][1], mv_cache[1][1], sizeof(int16_t)*4);
++ AV_COPY32(mv_cache[2][1], cur_frame->motion_val[0][mot_xy + mot_stride ]);
++ AV_COPY32(mv_cache[2][2], cur_frame->motion_val[0][mot_xy + mot_stride + 1]);
++
++ AV_COPY32(mv_cache[3][1], cur_frame->motion_val[0][mot_xy + mot_stride ]);
++ AV_COPY32(mv_cache[3][2], cur_frame->motion_val[0][mot_xy + mot_stride + 1]);
++
++ if (mb_y == 0 || IS_INTRA(cur_frame->mb_type[xy - s->mb_stride])) {
++ AV_COPY32(mv_cache[0][1], mv_cache[1][1]);
++ AV_COPY32(mv_cache[0][2], mv_cache[1][2]);
+ }else{
+- memcpy(mv_cache[0][1], s->current_picture.f.motion_val[0][mot_xy - mot_stride], sizeof(int16_t) * 4);
++ AV_COPY32(mv_cache[0][1], cur_frame->motion_val[0][mot_xy - mot_stride ]);
++ AV_COPY32(mv_cache[0][2], cur_frame->motion_val[0][mot_xy - mot_stride + 1]);
+ }
+
+- if (mb_x == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - 1])) {
++ if (mb_x == 0 || IS_INTRA(cur_frame->mb_type[xy - 1])) {
+ AV_COPY32(mv_cache[1][0], mv_cache[1][1]);
+ AV_COPY32(mv_cache[2][0], mv_cache[2][1]);
+ }else{
+- AV_COPY32(mv_cache[1][0], s->current_picture.f.motion_val[0][mot_xy - 1]);
+- AV_COPY32(mv_cache[2][0], s->current_picture.f.motion_val[0][mot_xy - 1 + mot_stride]);
++ AV_COPY32(mv_cache[1][0], cur_frame->motion_val[0][mot_xy - 1]);
++ AV_COPY32(mv_cache[2][0], cur_frame->motion_val[0][mot_xy - 1 + mot_stride]);
+ }
+
+- if (mb_x + 1 >= s->mb_width || IS_INTRA(s->current_picture.f.mb_type[xy + 1])) {
++ if (mb_x + 1 >= s->mb_width || IS_INTRA(cur_frame->mb_type[xy + 1])) {
+ AV_COPY32(mv_cache[1][3], mv_cache[1][2]);
+ AV_COPY32(mv_cache[2][3], mv_cache[2][2]);
+ }else{
+- AV_COPY32(mv_cache[1][3], s->current_picture.f.motion_val[0][mot_xy + 2]);
+- AV_COPY32(mv_cache[2][3], s->current_picture.f.motion_val[0][mot_xy + 2 + mot_stride]);
++ AV_COPY32(mv_cache[1][3], cur_frame->motion_val[0][mot_xy + 2]);
++ AV_COPY32(mv_cache[2][3], cur_frame->motion_val[0][mot_xy + 2 + mot_stride]);
+ }
+
+ mx = 0;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0034-doxygen-Drop-some-pointless-entries-from-PREDEFINED-.patch b/debian/patches/post-9beta2/0034-doxygen-Drop-some-pointless-entries-from-PREDEFINED-.patch
new file mode 100644
index 0000000..c551e1b
--- /dev/null
+++ b/debian/patches/post-9beta2/0034-doxygen-Drop-some-pointless-entries-from-PREDEFINED-.patch
@@ -0,0 +1,30 @@
+From 74e742d6ad09becc2d43e5382c141e0356ad6071 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Tue, 23 Oct 2012 21:12:48 +0200
+Subject: [PATCH 034/204] doxygen: Drop some pointless entries from PREDEFINED
+ macros list
+
+---
+ doc/Doxyfile | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/doc/Doxyfile b/doc/Doxyfile
+index 1b4e7d5..eb394f0 100644
+--- a/doc/Doxyfile
++++ b/doc/Doxyfile
+@@ -1374,12 +1374,6 @@ INCLUDE_FILE_PATTERNS =
+ # instead of the = operator.
+
+ PREDEFINED = "__attribute__(x)=" \
+- "RENAME(x)=x ## _TMPL" \
+- "DEF(x)=x ## _TMPL" \
+- HAVE_AV_CONFIG_H \
+- HAVE_MMX \
+- HAVE_MMXEXT \
+- HAVE_AMD3DNOW \
+ "DECLARE_ALIGNED(a,t,n)=t n" \
+ "offsetof(x,y)=0x42"
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0035-doxygen-Add-av_alloc_size-to-list-of-predefined-macr.patch b/debian/patches/post-9beta2/0035-doxygen-Add-av_alloc_size-to-list-of-predefined-macr.patch
new file mode 100644
index 0000000..e3ae494
--- /dev/null
+++ b/debian/patches/post-9beta2/0035-doxygen-Add-av_alloc_size-to-list-of-predefined-macr.patch
@@ -0,0 +1,28 @@
+From 13bbefd57e8dcabae650f4a02e667d5c003c289f Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Mon, 22 Oct 2012 16:16:07 +0200
+Subject: [PATCH 035/204] doxygen: Add av_alloc_size to list of predefined
+ macros
+
+This avoids Doxygen believing the attribute is the function name.
+---
+ doc/Doxyfile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/doc/Doxyfile b/doc/Doxyfile
+index eb394f0..aa1f4e2 100644
+--- a/doc/Doxyfile
++++ b/doc/Doxyfile
+@@ -1375,7 +1375,8 @@ INCLUDE_FILE_PATTERNS =
+
+ PREDEFINED = "__attribute__(x)=" \
+ "DECLARE_ALIGNED(a,t,n)=t n" \
+- "offsetof(x,y)=0x42"
++ "offsetof(x,y)=0x42" \
++ av_alloc_size \
+
+ # 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.
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0036-cook-cosmetics-Better-name-for-ccpl-COOKSubpacket-me.patch b/debian/patches/post-9beta2/0036-cook-cosmetics-Better-name-for-ccpl-COOKSubpacket-me.patch
new file mode 100644
index 0000000..cc6f2dd
--- /dev/null
+++ b/debian/patches/post-9beta2/0036-cook-cosmetics-Better-name-for-ccpl-COOKSubpacket-me.patch
@@ -0,0 +1,56 @@
+From 20015379a46a3b261f57b0daf0c7237b62c1fd82 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 01:05:04 +0200
+Subject: [PATCH 036/204] cook: cosmetics: Better name for ccpl COOKSubpacket
+ member
+
+---
+ libavcodec/cook.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index c5b17f9..28ee8ed 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -79,7 +79,7 @@ typedef struct {
+ int samples_per_channel;
+ int log2_numvector_size;
+ unsigned int channel_mask;
+- VLC ccpl; ///< channel coupling
++ VLC channel_coupling;
+ int joint_stereo;
+ int bits_per_subpacket;
+ int bits_per_subpdiv;
+@@ -205,7 +205,8 @@ static av_cold int init_cook_vlc_tables(COOKContext *q)
+
+ for (i = 0; i < q->num_subpackets; i++) {
+ if (q->subpacket[i].joint_stereo == 1) {
+- result |= init_vlc(&q->subpacket[i].ccpl, 6, (1 << q->subpacket[i].js_vlc_bits) - 1,
++ result |= init_vlc(&q->subpacket[i].channel_coupling, 6,
++ (1 << q->subpacket[i].js_vlc_bits) - 1,
+ ccpl_huffbits[q->subpacket[i].js_vlc_bits - 2], 1, 1,
+ ccpl_huffcodes[q->subpacket[i].js_vlc_bits - 2], 2, 2, 0);
+ av_log(q->avctx, AV_LOG_DEBUG, "subpacket %i Joint-stereo VLC used.\n", i);
+@@ -326,7 +327,7 @@ static av_cold int cook_decode_close(AVCodecContext *avctx)
+ for (i = 0; i < 7; i++)
+ ff_free_vlc(&q->sqvh[i]);
+ for (i = 0; i < q->num_subpackets; i++)
+- ff_free_vlc(&q->subpacket[i].ccpl);
++ ff_free_vlc(&q->subpacket[i].channel_coupling);
+
+ av_log(avctx, AV_LOG_DEBUG, "Memory deallocated.\n");
+
+@@ -767,7 +768,9 @@ static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
+
+ if (vlc)
+ for (i = 0; i < length; i++)
+- decouple_tab[start + i] = get_vlc2(&q->gb, p->ccpl.table, p->ccpl.bits, 2);
++ decouple_tab[start + i] = get_vlc2(&q->gb,
++ p->channel_coupling.table,
++ p->channel_coupling.bits, 2);
+ else
+ for (i = 0; i < length; i++)
+ decouple_tab[start + i] = get_bits(&q->gb, p->js_vlc_bits);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0037-cook-cosmetics-Better-names-for-joint_decode-functio.patch b/debian/patches/post-9beta2/0037-cook-cosmetics-Better-names-for-joint_decode-functio.patch
new file mode 100644
index 0000000..620cde7
--- /dev/null
+++ b/debian/patches/post-9beta2/0037-cook-cosmetics-Better-names-for-joint_decode-functio.patch
@@ -0,0 +1,60 @@
+From f23b4a068230fb4ebed2449cd5f303f3b16d333d Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 01:08:19 +0200
+Subject: [PATCH 037/204] cook: cosmetics: Better names for joint_decode()
+ function parameters
+
+---
+ libavcodec/cook.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index 28ee8ed..05efa50 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -809,8 +809,8 @@ static void decouple_float(COOKContext *q,
+ * @param mlt_buffer1 pointer to left channel mlt coefficients
+ * @param mlt_buffer2 pointer to right channel mlt coefficients
+ */
+-static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
+- float *mlt_buffer2)
++static int joint_decode(COOKContext *q, COOKSubpacket *p,
++ float *mlt_buffer_left, float *mlt_buffer_right)
+ {
+ int i, j, res;
+ int decouple_tab[SUBBAND_SIZE] = { 0 };
+@@ -822,8 +822,8 @@ static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
+ memset(decode_buffer, 0, sizeof(q->decode_buffer_0));
+
+ /* Make sure the buffers are zeroed out. */
+- memset(mlt_buffer1, 0, 1024 * sizeof(*mlt_buffer1));
+- memset(mlt_buffer2, 0, 1024 * sizeof(*mlt_buffer2));
++ memset(mlt_buffer_left, 0, 1024 * sizeof(*mlt_buffer_left));
++ memset(mlt_buffer_right, 0, 1024 * sizeof(*mlt_buffer_right));
+ decouple_info(q, p, decouple_tab);
+ if ((res = mono_decode(q, p, decode_buffer)) < 0)
+ return res;
+@@ -831,8 +831,8 @@ static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
+ /* The two channels are stored interleaved in decode_buffer. */
+ for (i = 0; i < p->js_subband_start; i++) {
+ for (j = 0; j < SUBBAND_SIZE; j++) {
+- mlt_buffer1[i * 20 + j] = decode_buffer[i * 40 + j];
+- mlt_buffer2[i * 20 + j] = decode_buffer[i * 40 + 20 + j];
++ mlt_buffer_left[i * 20 + j] = decode_buffer[i * 40 + j];
++ mlt_buffer_right[i * 20 + j] = decode_buffer[i * 40 + 20 + j];
+ }
+ }
+
+@@ -845,7 +845,8 @@ static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
+ cplscale = q->cplscales[p->js_vlc_bits - 2]; // choose decoupler table
+ f1 = cplscale[decouple_tab[cpl_tmp] + 1];
+ f2 = cplscale[idx];
+- q->decouple(q, p, i, f1, f2, decode_buffer, mlt_buffer1, mlt_buffer2);
++ q->decouple(q, p, i, f1, f2, decode_buffer,
++ mlt_buffer_left, mlt_buffer_right);
+ idx = (1 << p->js_vlc_bits) - 1;
+ }
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0038-cook-Remove-senseless-maybe_reformat_buffer32-functi.patch b/debian/patches/post-9beta2/0038-cook-Remove-senseless-maybe_reformat_buffer32-functi.patch
new file mode 100644
index 0000000..cf21596
--- /dev/null
+++ b/debian/patches/post-9beta2/0038-cook-Remove-senseless-maybe_reformat_buffer32-functi.patch
@@ -0,0 +1,36 @@
+From 8a61ba0e8194beffdfd9f843bdcf29dbbc974ca5 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 16:03:31 +0200
+Subject: [PATCH 038/204] cook: Remove senseless maybe_reformat_buffer32()
+ function
+
+---
+ libavcodec/cook.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index 05efa50..713d0b1 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -241,17 +241,11 @@ static av_cold int init_cook_mlt(COOKContext *q)
+ return 0;
+ }
+
+-static const float *maybe_reformat_buffer32(COOKContext *q, const float *ptr, int n)
+-{
+- if (1)
+- return ptr;
+-}
+-
+ static av_cold void init_cplscales_table(COOKContext *q)
+ {
+ int i;
+ for (i = 0; i < 5; i++)
+- q->cplscales[i] = maybe_reformat_buffer32(q, cplscales[i], (1 << (i + 2)) - 1);
++ q->cplscales[i] = cplscales[i];
+ }
+
+ /*************** init functions end ***********/
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0039-cook-Remove-some-silly-Doxygen-comments.patch b/debian/patches/post-9beta2/0039-cook-Remove-some-silly-Doxygen-comments.patch
new file mode 100644
index 0000000..11d4001
--- /dev/null
+++ b/debian/patches/post-9beta2/0039-cook-Remove-some-silly-Doxygen-comments.patch
@@ -0,0 +1,73 @@
+From 707f58f515eeb282563af3c443cac10c2d3e81b4 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 19:00:33 +0200
+Subject: [PATCH 039/204] cook: Remove some silly Doxygen comments
+
+---
+ libavcodec/cook.c | 19 ++-----------------
+ 1 file changed, 2 insertions(+), 17 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index 713d0b1..a45bd80 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -84,11 +84,11 @@ typedef struct {
+ int bits_per_subpacket;
+ int bits_per_subpdiv;
+ int total_subbands;
+- int numvector_size; ///< 1 << log2_numvector_size;
++ int numvector_size; // 1 << log2_numvector_size;
+
+ float mono_previous_buffer1[1024];
+ float mono_previous_buffer2[1024];
+- /** gain buffers */
++
+ cook_gains gains1;
+ cook_gains gains2;
+ int gain_1[9];
+@@ -299,9 +299,6 @@ static inline int decode_bytes(const uint8_t *inbuffer, uint8_t *out, int bytes)
+ return off;
+ }
+
+-/**
+- * Cook uninit
+- */
+ static av_cold int cook_decode_close(AVCodecContext *avctx)
+ {
+ int i;
+@@ -631,12 +628,6 @@ static void decode_vectors(COOKContext *q, COOKSubpacket *p, int *category,
+ }
+
+
+-/**
+- * function for decoding mono data
+- *
+- * @param q pointer to the COOKContext
+- * @param mlt_buffer pointer to mlt coefficients
+- */
+ static int mono_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer)
+ {
+ int category_index[128] = { 0 };
+@@ -747,7 +738,6 @@ static void imlt_gain(COOKContext *q, float *inbuffer,
+ *
+ * @param q pointer to the COOKContext
+ * @param decouple_tab decoupling array
+- *
+ */
+ static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
+ {
+@@ -954,11 +944,6 @@ static int decode_subpacket(COOKContext *q, COOKSubpacket *p,
+ }
+
+
+-/**
+- * Cook frame decoding
+- *
+- * @param avctx pointer to the AVCodecContext
+- */
+ static int cook_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+ {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0040-ivi_common-Drop-unused-function-parameter-from-decod.patch b/debian/patches/post-9beta2/0040-ivi_common-Drop-unused-function-parameter-from-decod.patch
new file mode 100644
index 0000000..59007aa
--- /dev/null
+++ b/debian/patches/post-9beta2/0040-ivi_common-Drop-unused-function-parameter-from-decod.patch
@@ -0,0 +1,35 @@
+From 87cdd7c6949e0166a22b558e0657ac277c95d452 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 11:54:03 +0200
+Subject: [PATCH 040/204] ivi_common: Drop unused function parameter from
+ decode_band()
+
+---
+ libavcodec/ivi_common.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
+index 149fffe..8566128 100644
+--- a/libavcodec/ivi_common.c
++++ b/libavcodec/ivi_common.c
+@@ -644,7 +644,7 @@ void ff_ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch)
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, -1 = error
+ */
+-static int decode_band(IVI45DecContext *ctx, int plane_num,
++static int decode_band(IVI45DecContext *ctx,
+ IVIBandDesc *band, AVCodecContext *avctx)
+ {
+ int result, i, t, idx1, idx2, pos;
+@@ -775,7 +775,7 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ if (ctx->is_nonnull_frame(ctx)) {
+ for (p = 0; p < 3; p++) {
+ for (b = 0; b < ctx->planes[p].num_bands; b++) {
+- result = decode_band(ctx, p, &ctx->planes[p].bands[b], avctx);
++ result = decode_band(ctx, &ctx->planes[p].bands[b], avctx);
+ if (result) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Error while decoding band: %d, plane: %d\n", b, p);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0041-doc-git-howto-Clarify-comment-about-pushing-series-o.patch b/debian/patches/post-9beta2/0041-doc-git-howto-Clarify-comment-about-pushing-series-o.patch
new file mode 100644
index 0000000..35adca9
--- /dev/null
+++ b/debian/patches/post-9beta2/0041-doc-git-howto-Clarify-comment-about-pushing-series-o.patch
@@ -0,0 +1,28 @@
+From ca7f59119b8a53d60418c4adccb0c46922795f79 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Thu, 25 Oct 2012 18:25:25 +0200
+Subject: [PATCH 041/204] doc: git-howto: Clarify comment about pushing series
+ of commits
+
+---
+ doc/git-howto.texi | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/doc/git-howto.texi b/doc/git-howto.texi
+index 5114115..68e0061 100644
+--- a/doc/git-howto.texi
++++ b/doc/git-howto.texi
+@@ -416,8 +416,8 @@ a panacea. Do not hesitate to perform any other tests necessary to convince
+ yourself that the changes you are about to push actually work as expected.
+
+ Also note that every single commit should pass the test suite, not just
+-the result of a series of patches. So if you have a series of related
+-commits, run the test suite on every single commit.
++the result of a series of patches. So if you have a series of commits
++to push, run the test suite on every single commit.
+
+ Finally, after pushing, mark all patches as committed on
+ @url{http://patches.libav.org/,patchwork}.
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0042-configure-fix-tests-for-2-arg-math-functions.patch b/debian/patches/post-9beta2/0042-configure-fix-tests-for-2-arg-math-functions.patch
new file mode 100644
index 0000000..7e6becd
--- /dev/null
+++ b/debian/patches/post-9beta2/0042-configure-fix-tests-for-2-arg-math-functions.patch
@@ -0,0 +1,47 @@
+From 1aa07aa21c4ee39f0ed5fcd33d8259eed74bd3ab Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 14:42:47 +0100
+Subject: [PATCH 042/204] configure: fix tests for 2-arg math functions
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/configure b/configure
+index bfa3a61..81f945f 100755
+--- a/configure
++++ b/configure
+@@ -785,11 +785,13 @@ EOF
+ check_mathfunc(){
+ log check_mathfunc "$@"
+ func=$1
+- shift
++ narg=$2
++ shift 2
++ test $narg = 2 && args="f, g" || args="f"
+ disable $func
+ check_ld "$@" <<EOF && enable $func
+ #include <math.h>
+-float foo(float f) { return $func(f); }
++float foo(float f, float g) { return $func($args); }
+ int main(void){ return 0; }
+ EOF
+ }
+@@ -3306,8 +3308,12 @@ done
+ check_lib math.h sin -lm && LIBM="-lm"
+ enabled vaapi && require vaapi va/va.h vaInitialize -lva
+
++atan2f_args=2
++ldexpf_args=2
++powf_args=2
++
+ for func in $MATH_FUNCS; do
+- check_mathfunc $func
++ eval check_mathfunc $func \${${func}_args:-1}
+ done
+
+ # these are off by default, so fail if requested and not available
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0043-buffersink-remove-stray-semicolon-after-function-def.patch b/debian/patches/post-9beta2/0043-buffersink-remove-stray-semicolon-after-function-def.patch
new file mode 100644
index 0000000..4a80240
--- /dev/null
+++ b/debian/patches/post-9beta2/0043-buffersink-remove-stray-semicolon-after-function-def.patch
@@ -0,0 +1,27 @@
+From 6b776c61da26428ca67abec919c8a186a276ca66 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 17:58:19 +0100
+Subject: [PATCH 043/204] buffersink: remove stray semicolon after function
+ definition
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavfilter/buffersink.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
+index 73af25d..c68b909 100644
+--- a/libavfilter/buffersink.c
++++ b/libavfilter/buffersink.c
+@@ -57,7 +57,7 @@ static int start_frame(AVFilterLink *link, AVFilterBufferRef *buf)
+ link->cur_buf = NULL;
+
+ return 0;
+-};
++}
+
+ int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf)
+ {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0044-af_channelmap-remove-stray-enum-declaration.patch b/debian/patches/post-9beta2/0044-af_channelmap-remove-stray-enum-declaration.patch
new file mode 100644
index 0000000..d279057
--- /dev/null
+++ b/debian/patches/post-9beta2/0044-af_channelmap-remove-stray-enum-declaration.patch
@@ -0,0 +1,25 @@
+From 67a68dcec2271336c859d1fbd8f40c268f54ec8a Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 22:25:37 +0100
+Subject: [PATCH 044/204] af_channelmap: remove stray enum declaration
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavfilter/af_channelmap.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
+index 8c49d10..f70b481 100644
+--- a/libavfilter/af_channelmap.c
++++ b/libavfilter/af_channelmap.c
+@@ -124,7 +124,6 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
+ ChannelMapContext *s = ctx->priv;
+ int ret;
+ char *mapping;
+- enum mode;
+ int map_entries = 0;
+ char buf[256];
+ enum MappingMode mode;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0045-network-use-HAVE_THREADS-instead-of-local-hack.patch b/debian/patches/post-9beta2/0045-network-use-HAVE_THREADS-instead-of-local-hack.patch
new file mode 100644
index 0000000..412385d
--- /dev/null
+++ b/debian/patches/post-9beta2/0045-network-use-HAVE_THREADS-instead-of-local-hack.patch
@@ -0,0 +1,78 @@
+From 9efbfe57e082b0f42bf0c830a4fdc6b80d2b13ca Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 19:33:59 +0100
+Subject: [PATCH 045/204] network: use HAVE_THREADS instead of local hack
+
+HAVE_THREADS is set in config.h if pthreads or w32threads is
+available, which presumably the proper condition here.
+
+Also fixes undefined behaviour in preprocessor directives.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavformat/network.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/libavformat/network.c b/libavformat/network.c
+index 5b2b958..fe17bdf 100644
+--- a/libavformat/network.c
++++ b/libavformat/network.c
+@@ -22,9 +22,7 @@
+ #include "libavcodec/internal.h"
+ #include "libavutil/mem.h"
+
+-#define THREADS (HAVE_PTHREADS || (defined(WIN32) && !defined(__MINGW32CE__)))
+-
+-#if THREADS
++#if HAVE_THREADS
+ #if HAVE_PTHREADS
+ #include <pthread.h>
+ #else
+@@ -35,7 +33,7 @@
+ #if CONFIG_OPENSSL
+ #include <openssl/ssl.h>
+ static int openssl_init;
+-#if THREADS
++#if HAVE_THREADS
+ #include <openssl/crypto.h>
+ #include "libavutil/avutil.h"
+ pthread_mutex_t *openssl_mutexes;
+@@ -56,7 +54,7 @@ static unsigned long openssl_thread_id(void)
+ #endif
+ #if CONFIG_GNUTLS
+ #include <gnutls/gnutls.h>
+-#if THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
++#if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
+ #include <gcrypt.h>
+ #include <errno.h>
+ #undef malloc
+@@ -72,7 +70,7 @@ void ff_tls_init(void)
+ if (!openssl_init) {
+ SSL_library_init();
+ SSL_load_error_strings();
+-#if THREADS
++#if HAVE_THREADS
+ if (!CRYPTO_get_locking_callback()) {
+ int i;
+ openssl_mutexes = av_malloc(sizeof(pthread_mutex_t) * CRYPTO_num_locks());
+@@ -88,7 +86,7 @@ void ff_tls_init(void)
+ openssl_init++;
+ #endif
+ #if CONFIG_GNUTLS
+-#if THREADS && GNUTLS_VERSION_NUMBER < 0x020b00
++#if HAVE_THREADS && GNUTLS_VERSION_NUMBER < 0x020b00
+ if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)
+ gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+ #endif
+@@ -103,7 +101,7 @@ void ff_tls_deinit(void)
+ #if CONFIG_OPENSSL
+ openssl_init--;
+ if (!openssl_init) {
+-#if THREADS
++#if HAVE_THREADS
+ if (CRYPTO_get_locking_callback() == openssl_lock) {
+ int i;
+ CRYPTO_set_locking_callback(NULL);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0046-udp-use-socklen_t-where-appropriate.patch b/debian/patches/post-9beta2/0046-udp-use-socklen_t-where-appropriate.patch
new file mode 100644
index 0000000..05f4b4c
--- /dev/null
+++ b/debian/patches/post-9beta2/0046-udp-use-socklen_t-where-appropriate.patch
@@ -0,0 +1,38 @@
+From be2efe0c7b6a8188988d7de5da236d794312b5bb Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 19:46:37 +0100
+Subject: [PATCH 046/204] udp: use socklen_t where appropriate
+
+getsockname() takes a pointer to socklen_t which is not necessarily
+int.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavformat/udp.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavformat/udp.c b/libavformat/udp.c
+index e848ecd..373a4c9 100644
+--- a/libavformat/udp.c
++++ b/libavformat/udp.c
+@@ -257,7 +257,7 @@ static int udp_set_url(struct sockaddr_storage *addr,
+ }
+
+ static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr,
+- int *addr_len, const char *localaddr)
++ socklen_t *addr_len, const char *localaddr)
+ {
+ int udp_fd = -1;
+ struct addrinfo *res0 = NULL, *res = NULL;
+@@ -389,7 +389,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
+ const char *p;
+ char buf[256];
+ struct sockaddr_storage my_addr;
+- int len;
++ socklen_t len;
+ int reuse_specified = 0;
+ int i, include = 0, num_sources = 0;
+ char *sources[32];
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0047-avserver-use-socklen_t-where-appropriate.patch b/debian/patches/post-9beta2/0047-avserver-use-socklen_t-where-appropriate.patch
new file mode 100644
index 0000000..d1d6ccc
--- /dev/null
+++ b/debian/patches/post-9beta2/0047-avserver-use-socklen_t-where-appropriate.patch
@@ -0,0 +1,50 @@
+From cc64ec570c92fe39db3f1db8c877a8cc70e3b668 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 21:53:31 +0100
+Subject: [PATCH 047/204] avserver: use socklen_t where appropriate
+
+Various socket functions expect a pointer to socklen_t which is not
+necessarily int.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ avserver.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/avserver.c b/avserver.c
+index 994edcd..f9d85d8 100644
+--- a/avserver.c
++++ b/avserver.c
+@@ -799,7 +799,8 @@ static void http_send_too_busy_reply(int fd)
+ static void new_connection(int server_fd, int is_rtsp)
+ {
+ struct sockaddr_in from_addr;
+- int fd, len;
++ socklen_t len;
++ int fd;
+ HTTPContext *c = NULL;
+
+ len = sizeof(from_addr);
+@@ -1717,7 +1718,8 @@ static int http_parse_request(HTTPContext *c)
+ case REDIR_SDP:
+ {
+ uint8_t *sdp_data;
+- int sdp_data_size, len;
++ int sdp_data_size;
++ socklen_t len;
+ struct sockaddr_in my_addr;
+
+ q += snprintf(q, c->buffer_size,
+@@ -2991,7 +2993,8 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
+ char path1[1024];
+ const char *path;
+ uint8_t *content;
+- int content_length, len;
++ int content_length;
++ socklen_t len;
+ struct sockaddr_in my_addr;
+
+ /* find which url is asked */
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0048-avio-fix-pointer-type-mismatches-in-avio_enum_protoc.patch b/debian/patches/post-9beta2/0048-avio-fix-pointer-type-mismatches-in-avio_enum_protoc.patch
new file mode 100644
index 0000000..8214c90
--- /dev/null
+++ b/debian/patches/post-9beta2/0048-avio-fix-pointer-type-mismatches-in-avio_enum_protoc.patch
@@ -0,0 +1,35 @@
+From 4521645b1aee9e9ad8f5cea7b2392cd5f6ffcd26 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 18:42:29 +0100
+Subject: [PATCH 048/204] avio: fix pointer type mismatches in
+ avio_enum_protocols()
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavformat/avio.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/libavformat/avio.c b/libavformat/avio.c
+index 45ee866..a43b241 100644
+--- a/libavformat/avio.c
++++ b/libavformat/avio.c
+@@ -85,11 +85,11 @@ const AVClass ffurl_context_class = {
+
+ const char *avio_enum_protocols(void **opaque, int output)
+ {
+- URLProtocol **p = opaque;
+- *p = ffurl_protocol_next(*p);
+- if (!*p) return NULL;
+- if ((output && (*p)->url_write) || (!output && (*p)->url_read))
+- return (*p)->name;
++ URLProtocol *p;
++ *opaque = ffurl_protocol_next(*opaque);
++ if (!(p = *opaque)) return NULL;
++ if ((output && p->url_write) || (!output && p->url_read))
++ return p->name;
+ return avio_enum_protocols(opaque, output);
+ }
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0049-amrwbdec-fix-invalid-pointer-arithmetic.patch b/debian/patches/post-9beta2/0049-amrwbdec-fix-invalid-pointer-arithmetic.patch
new file mode 100644
index 0000000..7110f4a
--- /dev/null
+++ b/debian/patches/post-9beta2/0049-amrwbdec-fix-invalid-pointer-arithmetic.patch
@@ -0,0 +1,67 @@
+From 50be207759aa7a69a27de585f7d870ec41eba036 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 22:44:38 +0100
+Subject: [PATCH 049/204] amrwbdec: fix invalid pointer arithmetic
+
+Subtracting a (positive) value from the address of an array violates
+C99 section 6.5.6:
+
+ If both the pointer operand and the result point to elements of the
+ same array object, or one past the last element of the array object,
+ the evaluation shall not produce an overflow; otherwise, the
+ behavior is undefined.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavcodec/amrwbdec.c | 21 ++++++++++-----------
+ 1 file changed, 10 insertions(+), 11 deletions(-)
+
+diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
+index 5cc96ab..c9c793f 100644
+--- a/libavcodec/amrwbdec.c
++++ b/libavcodec/amrwbdec.c
+@@ -902,10 +902,9 @@ static float auto_correlation(float *diff_isf, float mean, int lag)
+ static void extrapolate_isf(float isf[LP_ORDER_16k])
+ {
+ float diff_isf[LP_ORDER - 2], diff_mean;
+- float *diff_hi = diff_isf - LP_ORDER + 1; // diff array for extrapolated indexes
+ float corr_lag[3];
+ float est, scale;
+- int i, i_max_corr;
++ int i, j, i_max_corr;
+
+ isf[LP_ORDER_16k - 1] = isf[LP_ORDER - 1];
+
+@@ -936,20 +935,20 @@ static void extrapolate_isf(float isf[LP_ORDER_16k])
+ scale = 0.5 * (FFMIN(est, 7600) - isf[LP_ORDER - 2]) /
+ (isf[LP_ORDER_16k - 2] - isf[LP_ORDER - 2]);
+
+- for (i = LP_ORDER - 1; i < LP_ORDER_16k - 1; i++)
+- diff_hi[i] = scale * (isf[i] - isf[i - 1]);
++ for (i = LP_ORDER - 1, j = 0; i < LP_ORDER_16k - 1; i++, j++)
++ diff_isf[j] = scale * (isf[i] - isf[i - 1]);
+
+ /* Stability insurance */
+- for (i = LP_ORDER; i < LP_ORDER_16k - 1; i++)
+- if (diff_hi[i] + diff_hi[i - 1] < 5.0) {
+- if (diff_hi[i] > diff_hi[i - 1]) {
+- diff_hi[i - 1] = 5.0 - diff_hi[i];
++ for (i = 1; i < LP_ORDER_16k - LP_ORDER; i++)
++ if (diff_isf[i] + diff_isf[i - 1] < 5.0) {
++ if (diff_isf[i] > diff_isf[i - 1]) {
++ diff_isf[i - 1] = 5.0 - diff_isf[i];
+ } else
+- diff_hi[i] = 5.0 - diff_hi[i - 1];
++ diff_isf[i] = 5.0 - diff_isf[i - 1];
+ }
+
+- for (i = LP_ORDER - 1; i < LP_ORDER_16k - 1; i++)
+- isf[i] = isf[i - 1] + diff_hi[i] * (1.0f / (1 << 15));
++ for (i = LP_ORDER - 1, j = 0; i < LP_ORDER_16k - 1; i++, j++)
++ isf[i] = isf[i - 1] + diff_isf[j] * (1.0f / (1 << 15));
+
+ /* Scale the ISF vector for 16000 Hz */
+ for (i = 0; i < LP_ORDER_16k - 1; i++)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0050-h264-fix-invalid-pointer-arithmetic.patch b/debian/patches/post-9beta2/0050-h264-fix-invalid-pointer-arithmetic.patch
new file mode 100644
index 0000000..985ac7b
--- /dev/null
+++ b/debian/patches/post-9beta2/0050-h264-fix-invalid-pointer-arithmetic.patch
@@ -0,0 +1,60 @@
+From c4cccc8d3f6605c5fdd73723a865486c5b7fb117 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 21:18:33 +0100
+Subject: [PATCH 050/204] h264: fix invalid pointer arithmetic
+
+Subtracting a (positive) value from the address of an array violates
+C99 section 6.5.6:
+
+ If both the pointer operand and the result point to elements of the
+ same array object, or one past the last element of the array object,
+ the evaluation shall not produce an overflow; otherwise, the
+ behavior is undefined.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavcodec/h264_cavlc.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
+index 8996057..8702122 100644
+--- a/libavcodec/h264_cavlc.c
++++ b/libavcodec/h264_cavlc.c
+@@ -566,13 +566,13 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
+ else{
+ if (max_coeff <= 8) {
+ if (max_coeff == 4)
+- zeros_left = get_vlc2(gb, (chroma_dc_total_zeros_vlc-1)[total_coeff].table,
++ zeros_left = get_vlc2(gb, chroma_dc_total_zeros_vlc[total_coeff - 1].table,
+ CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1);
+ else
+- zeros_left = get_vlc2(gb, (chroma422_dc_total_zeros_vlc-1)[total_coeff].table,
++ zeros_left = get_vlc2(gb, chroma422_dc_total_zeros_vlc[total_coeff - 1].table,
+ CHROMA422_DC_TOTAL_ZEROS_VLC_BITS, 1);
+ } else {
+- zeros_left= get_vlc2(gb, (total_zeros_vlc-1)[ total_coeff ].table, TOTAL_ZEROS_VLC_BITS, 1);
++ zeros_left= get_vlc2(gb, total_zeros_vlc[total_coeff - 1].table, TOTAL_ZEROS_VLC_BITS, 1);
+ }
+ }
+
+@@ -582,7 +582,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
+ ((type*)block)[*scantable] = level[0]; \
+ for(i=1;i<total_coeff && zeros_left > 0;i++) { \
+ if(zeros_left < 7) \
+- run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1); \
++ run_before= get_vlc2(gb, run_vlc[zeros_left - 1].table, RUN_VLC_BITS, 1); \
+ else \
+ run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); \
+ zeros_left -= run_before; \
+@@ -597,7 +597,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
+ ((type*)block)[*scantable] = ((int)(level[0] * qmul[*scantable] + 32))>>6; \
+ for(i=1;i<total_coeff && zeros_left > 0;i++) { \
+ if(zeros_left < 7) \
+- run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1); \
++ run_before= get_vlc2(gb, run_vlc[zeros_left - 1].table, RUN_VLC_BITS, 1); \
+ else \
+ run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); \
+ zeros_left -= run_before; \
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0051-vp8-fix-memset-crossing-array-boundary.patch b/debian/patches/post-9beta2/0051-vp8-fix-memset-crossing-array-boundary.patch
new file mode 100644
index 0000000..2a08816
--- /dev/null
+++ b/debian/patches/post-9beta2/0051-vp8-fix-memset-crossing-array-boundary.patch
@@ -0,0 +1,29 @@
+From 4471a2420717d8dc10b573cca50292d0d598d925 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 21:43:55 +0100
+Subject: [PATCH 051/204] vp8: fix memset() crossing array boundary
+
+Indexing across array boundaries is not allowed by C99.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavcodec/vp8.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
+index 2766c9e..d9902c4 100644
+--- a/libavcodec/vp8.c
++++ b/libavcodec/vp8.c
+@@ -1964,7 +1964,8 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ // top edge of 127 for intra prediction
+ if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
+ s->top_border[0][15] = s->top_border[0][23] = 127;
+- memset(s->top_border[1]-1, 127, s->mb_width*sizeof(*s->top_border)+1);
++ s->top_border[0][31] = 127;
++ memset(s->top_border[1], 127, s->mb_width*sizeof(*s->top_border));
+ }
+ memset(s->ref_count, 0, sizeof(s->ref_count));
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0052-configure-detect-sparc64-automatically.patch b/debian/patches/post-9beta2/0052-configure-detect-sparc64-automatically.patch
new file mode 100644
index 0000000..9383ccc
--- /dev/null
+++ b/debian/patches/post-9beta2/0052-configure-detect-sparc64-automatically.patch
@@ -0,0 +1,48 @@
+From 4cd217c065e948a9cec38fef9c544d3c26ff8f37 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Wed, 24 Oct 2012 18:34:21 +0100
+Subject: [PATCH 052/204] configure: detect sparc64 automatically
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/configure b/configure
+index 81f945f..1a006be 100755
+--- a/configure
++++ b/configure
+@@ -2474,9 +2474,8 @@ case "$arch" in
+ sh4|sh)
+ arch="sh4"
+ ;;
+- sun4u|sparc64)
++ sun4u|sparc*)
+ arch="sparc"
+- subarch="sparc64"
+ ;;
+ tilegx|tile-gx)
+ arch="tilegx"
+@@ -2671,7 +2670,7 @@ check_64bit(){
+ }
+
+ case "$arch" in
+- alpha|ia64|sparc)
++ alpha|ia64)
+ spic=$shared
+ ;;
+ mips)
+@@ -2685,6 +2684,10 @@ case "$arch" in
+ ppc)
+ check_64bit ppc ppc64 'sizeof(void *) > 4'
+ ;;
++ sparc)
++ check_64bit sparc sparc64 'sizeof(void *) > 4'
++ spic=$shared
++ ;;
+ x86)
+ check_64bit x86_32 x86_64 'sizeof(void *) > 4'
+ if test "$subarch" = "x86_64"; then
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0053-assdec-fix-qsort-callback-signature.patch b/debian/patches/post-9beta2/0053-assdec-fix-qsort-callback-signature.patch
new file mode 100644
index 0000000..f531ac6
--- /dev/null
+++ b/debian/patches/post-9beta2/0053-assdec-fix-qsort-callback-signature.patch
@@ -0,0 +1,40 @@
+From 4cbae57cef65df8705b77cf882372f835a42d842 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Fri, 26 Oct 2012 17:59:50 +0100
+Subject: [PATCH 053/204] assdec: fix qsort() callback signature
+
+This changes the event_cmp() function to the correct signature,
+avoiding an ugly cast.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ libavformat/assdec.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/libavformat/assdec.c b/libavformat/assdec.c
+index 3d39845..0041ca4 100644
+--- a/libavformat/assdec.c
++++ b/libavformat/assdec.c
+@@ -68,8 +68,9 @@ static int64_t get_pts(const uint8_t *p)
+ return sec*100+hsec;
+ }
+
+-static int event_cmp(uint8_t **a, uint8_t **b)
++static int event_cmp(const void *_a, const void *_b)
+ {
++ const uint8_t *const *a = _a, *const *b = _b;
+ return get_pts(*a) - get_pts(*b);
+ }
+
+@@ -131,7 +132,7 @@ static int read_header(AVFormatContext *s)
+ p++;
+ }
+
+- qsort(ass->event, ass->event_count, sizeof(*ass->event), (void*)event_cmp);
++ qsort(ass->event, ass->event_count, sizeof(*ass->event), event_cmp);
+
+ return 0;
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0054-nutenc-K-R-formatting-cosmetics.patch b/debian/patches/post-9beta2/0054-nutenc-K-R-formatting-cosmetics.patch
new file mode 100644
index 0000000..0998120
--- /dev/null
+++ b/debian/patches/post-9beta2/0054-nutenc-K-R-formatting-cosmetics.patch
@@ -0,0 +1,1142 @@
+From fce4450dec2f1287124a5c129281100f729f5771 Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Sat, 27 Oct 2012 00:41:02 +0200
+Subject: [PATCH 054/204] nutenc: K&R formatting cosmetics
+
+---
+ libavformat/nutenc.c | 753 +++++++++++++++++++++++++++-----------------------
+ 1 file changed, 412 insertions(+), 341 deletions(-)
+
+diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
+index 9985cd9..581a202 100644
+--- a/libavformat/nutenc.c
++++ b/libavformat/nutenc.c
+@@ -28,59 +28,68 @@
+ #include "internal.h"
+ #include "avio_internal.h"
+
+-static int find_expected_header(AVCodecContext *c, int size, int key_frame, uint8_t out[64]){
+- int sample_rate= c->sample_rate;
++static int find_expected_header(AVCodecContext *c, int size, int key_frame,
++ uint8_t out[64])
++{
++ int sample_rate = c->sample_rate;
+
+- if(size>4096)
++ if (size > 4096)
+ return 0;
+
+ AV_WB24(out, 1);
+
+- if(c->codec_id == AV_CODEC_ID_MPEG4){
+- if(key_frame){
++ if (c->codec_id == AV_CODEC_ID_MPEG4) {
++ if (key_frame) {
+ return 3;
+- }else{
+- out[3]= 0xB6;
++ } else {
++ out[3] = 0xB6;
+ return 4;
+ }
+- }else if(c->codec_id == AV_CODEC_ID_MPEG1VIDEO || c->codec_id == AV_CODEC_ID_MPEG2VIDEO){
++ } else if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
++ c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
+ return 3;
+- }else if(c->codec_id == AV_CODEC_ID_H264){
++ } else if (c->codec_id == AV_CODEC_ID_H264) {
+ return 3;
+- }else if(c->codec_id == AV_CODEC_ID_MP3 || c->codec_id == AV_CODEC_ID_MP2){
++ } else if (c->codec_id == AV_CODEC_ID_MP3 ||
++ c->codec_id == AV_CODEC_ID_MP2) {
+ int lsf, mpeg25, sample_rate_index, bitrate_index, frame_size;
+- int layer= c->codec_id == AV_CODEC_ID_MP3 ? 3 : 2;
+- unsigned int header= 0xFFF00000;
++ int layer = c->codec_id == AV_CODEC_ID_MP3 ? 3 : 2;
++ unsigned int header = 0xFFF00000;
+
+- lsf = sample_rate < (24000+32000)/2;
+- mpeg25 = sample_rate < (12000+16000)/2;
++ lsf = sample_rate < (24000 + 32000) / 2;
++ mpeg25 = sample_rate < (12000 + 16000) / 2;
+ sample_rate <<= lsf + mpeg25;
+- if (sample_rate < (32000 + 44100)/2) sample_rate_index=2;
+- else if(sample_rate < (44100 + 48000)/2) sample_rate_index=0;
+- else sample_rate_index=1;
++ if (sample_rate < (32000 + 44100) / 2)
++ sample_rate_index = 2;
++ else if (sample_rate < (44100 + 48000) / 2)
++ sample_rate_index = 0;
++ else
++ sample_rate_index = 1;
+
+- sample_rate= avpriv_mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25);
++ sample_rate = avpriv_mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25);
+
+- for(bitrate_index=2; bitrate_index<30; bitrate_index++){
+- frame_size = avpriv_mpa_bitrate_tab[lsf][layer-1][bitrate_index>>1];
+- frame_size = (frame_size * 144000) / (sample_rate << lsf) + (bitrate_index&1);
++ for (bitrate_index = 2; bitrate_index < 30; bitrate_index++) {
++ frame_size =
++ avpriv_mpa_bitrate_tab[lsf][layer - 1][bitrate_index >> 1];
++ frame_size = (frame_size * 144000) / (sample_rate << lsf) +
++ (bitrate_index & 1);
+
+- if(frame_size == size)
++ if (frame_size == size)
+ break;
+ }
+
+- header |= (!lsf)<<19;
+- header |= (4-layer)<<17;
+- header |= 1<<16; //no crc
++ header |= (!lsf) << 19;
++ header |= (4 - layer) << 17;
++ header |= 1 << 16; //no crc
+ AV_WB32(out, header);
+- if(size <= 0)
+- return 2; //we guess there is no crc, if there is one the user clearly does not care about overhead
+- if(bitrate_index == 30)
+- return -1; //something is wrong ...
++ if (size <= 0)
++ return 2; //we guess there is no crc, if there is one the user clearly does not care about overhead
++ if (bitrate_index == 30)
++ return -1; //something is wrong ...
+
+- header |= (bitrate_index>>1)<<12;
+- header |= sample_rate_index<<10;
+- header |= (bitrate_index&1)<<9;
++ header |= (bitrate_index >> 1) << 12;
++ header |= sample_rate_index << 10;
++ header |= (bitrate_index & 1) << 9;
+
+ return 2; //FIXME actually put the needed ones in build_elision_headers()
+ return 3; //we guess that the private bit is not set
+@@ -89,173 +98,178 @@ static int find_expected_header(AVCodecContext *c, int size, int key_frame, uint
+ return 0;
+ }
+
+-static int find_header_idx(AVFormatContext *s, AVCodecContext *c, int size, int frame_type){
++static int find_header_idx(AVFormatContext *s, AVCodecContext *c, int size,
++ int frame_type)
++{
+ NUTContext *nut = s->priv_data;
+ uint8_t out[64];
+ int i;
+- int len= find_expected_header(c, size, frame_type, out);
++ int len = find_expected_header(c, size, frame_type, out);
+
+- for(i=1; i<nut->header_count; i++){
+- if( len == nut->header_len[i]
+- && !memcmp(out, nut->header[i], len)){
++ for (i = 1; i < nut->header_count; i++) {
++ if (len == nut->header_len[i] && !memcmp(out, nut->header[i], len)) {
+ return i;
+ }
+ }
++
+ return 0;
+ }
+
+-static void build_elision_headers(AVFormatContext *s){
++static void build_elision_headers(AVFormatContext *s)
++{
+ NUTContext *nut = s->priv_data;
+ int i;
+ //FIXME this is lame
+ //FIXME write a 2pass mode to find the maximal headers
+- static const uint8_t headers[][5]={
+- {3, 0x00, 0x00, 0x01},
+- {4, 0x00, 0x00, 0x01, 0xB6},
+- {2, 0xFF, 0xFA}, //mp3+crc
+- {2, 0xFF, 0xFB}, //mp3
+- {2, 0xFF, 0xFC}, //mp2+crc
+- {2, 0xFF, 0xFD}, //mp2
++ static const uint8_t headers[][5] = {
++ { 3, 0x00, 0x00, 0x01 },
++ { 4, 0x00, 0x00, 0x01, 0xB6},
++ { 2, 0xFF, 0xFA }, //mp3+crc
++ { 2, 0xFF, 0xFB }, //mp3
++ { 2, 0xFF, 0xFC }, //mp2+crc
++ { 2, 0xFF, 0xFD }, //mp2
+ };
+
+- nut->header_count= 7;
+- for(i=1; i<nut->header_count; i++){
+- nut->header_len[i]= headers[i-1][0];
+- nut->header [i]= &headers[i-1][1];
++ nut->header_count = 7;
++ for (i = 1; i < nut->header_count; i++) {
++ nut->header_len[i] = headers[i - 1][0];
++ nut->header[i] = &headers[i - 1][1];
+ }
+ }
+
+-static void build_frame_code(AVFormatContext *s){
++static void build_frame_code(AVFormatContext *s)
++{
+ NUTContext *nut = s->priv_data;
+ int key_frame, index, pred, stream_id;
+- int start=1;
+- int end= 254;
+- int keyframe_0_esc= s->nb_streams > 2;
++ int start = 1;
++ int end = 254;
++ int keyframe_0_esc = s->nb_streams > 2;
+ int pred_table[10];
+ FrameCode *ft;
+
+- ft= &nut->frame_code[start];
+- ft->flags= FLAG_CODED;
+- ft->size_mul=1;
+- ft->pts_delta=1;
++ ft = &nut->frame_code[start];
++ ft->flags = FLAG_CODED;
++ ft->size_mul = 1;
++ ft->pts_delta = 1;
+ start++;
+
+- if(keyframe_0_esc){
++ if (keyframe_0_esc) {
+ /* keyframe = 0 escape */
+- FrameCode *ft= &nut->frame_code[start];
+- ft->flags= FLAG_STREAM_ID | FLAG_SIZE_MSB | FLAG_CODED_PTS;
+- ft->size_mul=1;
++ FrameCode *ft = &nut->frame_code[start];
++ ft->flags = FLAG_STREAM_ID | FLAG_SIZE_MSB | FLAG_CODED_PTS;
++ ft->size_mul = 1;
+ start++;
+ }
+
+- for(stream_id= 0; stream_id<s->nb_streams; stream_id++){
+- int start2= start + (end-start)*stream_id / s->nb_streams;
+- int end2 = start + (end-start)*(stream_id+1) / s->nb_streams;
++ for (stream_id = 0; stream_id < s->nb_streams; stream_id++) {
++ int start2 = start + (end - start) * stream_id / s->nb_streams;
++ int end2 = start + (end - start) * (stream_id + 1) / s->nb_streams;
+ AVCodecContext *codec = s->streams[stream_id]->codec;
+- int is_audio= codec->codec_type == AVMEDIA_TYPE_AUDIO;
+- int intra_only= /*codec->intra_only || */is_audio;
++ int is_audio = codec->codec_type == AVMEDIA_TYPE_AUDIO;
++ int intra_only = /*codec->intra_only || */ is_audio;
+ int pred_count;
+
+- 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*key_frame;
+- ft->flags|= FLAG_SIZE_MSB | FLAG_CODED_PTS;
+- ft->stream_id= stream_id;
+- ft->size_mul=1;
+- if(is_audio)
+- ft->header_idx= find_header_idx(s, codec, -1, key_frame);
++ for (key_frame = 0; key_frame < 2; key_frame++) {
++ if (!intra_only || !keyframe_0_esc || key_frame != 0) {
++ FrameCode *ft = &nut->frame_code[start2];
++ ft->flags = FLAG_KEY * key_frame;
++ ft->flags |= FLAG_SIZE_MSB | FLAG_CODED_PTS;
++ ft->stream_id = stream_id;
++ ft->size_mul = 1;
++ if (is_audio)
++ ft->header_idx = find_header_idx(s, codec, -1, key_frame);
+ start2++;
+ }
+ }
+
+- key_frame= intra_only;
+- if(is_audio){
+- int frame_bytes= codec->frame_size*(int64_t)codec->bit_rate / (8*codec->sample_rate);
++ key_frame = intra_only;
++ if (is_audio) {
++ int frame_bytes = codec->frame_size * (int64_t)codec->bit_rate /
++ (8 * codec->sample_rate);
+ int pts;
+- for(pts=0; pts<2; pts++){
+- for(pred=0; pred<2; pred++){
+- FrameCode *ft= &nut->frame_code[start2];
+- ft->flags= FLAG_KEY*key_frame;
+- ft->stream_id= stream_id;
+- ft->size_mul=frame_bytes + 2;
+- ft->size_lsb=frame_bytes + pred;
+- ft->pts_delta=pts;
+- ft->header_idx= find_header_idx(s, codec, frame_bytes + pred, key_frame);
++ for (pts = 0; pts < 2; pts++)
++ for (pred = 0; pred < 2; pred++) {
++ FrameCode *ft = &nut->frame_code[start2];
++ ft->flags = FLAG_KEY * key_frame;
++ ft->stream_id = stream_id;
++ ft->size_mul = frame_bytes + 2;
++ ft->size_lsb = frame_bytes + pred;
++ ft->pts_delta = pts;
++ ft->header_idx = find_header_idx(s, codec, frame_bytes + pred, key_frame);
+ start2++;
+ }
+- }
+- }else{
+- FrameCode *ft= &nut->frame_code[start2];
+- ft->flags= FLAG_KEY | FLAG_SIZE_MSB;
+- ft->stream_id= stream_id;
+- ft->size_mul=1;
+- ft->pts_delta=1;
++ } else {
++ FrameCode *ft = &nut->frame_code[start2];
++ ft->flags = FLAG_KEY | FLAG_SIZE_MSB;
++ ft->stream_id = stream_id;
++ ft->size_mul = 1;
++ ft->pts_delta = 1;
+ start2++;
+ }
+
+- if(codec->has_b_frames){
+- pred_count=5;
+- pred_table[0]=-2;
+- pred_table[1]=-1;
+- pred_table[2]=1;
+- pred_table[3]=3;
+- pred_table[4]=4;
+- }else if(codec->codec_id == AV_CODEC_ID_VORBIS){
+- pred_count=3;
+- pred_table[0]=2;
+- pred_table[1]=9;
+- pred_table[2]=16;
+- }else{
+- pred_count=1;
+- pred_table[0]=1;
++ if (codec->has_b_frames) {
++ pred_count = 5;
++ pred_table[0] = -2;
++ pred_table[1] = -1;
++ pred_table[2] = 1;
++ pred_table[3] = 3;
++ pred_table[4] = 4;
++ } else if (codec->codec_id == AV_CODEC_ID_VORBIS) {
++ pred_count = 3;
++ pred_table[0] = 2;
++ pred_table[1] = 9;
++ pred_table[2] = 16;
++ } else {
++ pred_count = 1;
++ pred_table[0] = 1;
+ }
+
+- for(pred=0; pred<pred_count; pred++){
+- int start3= start2 + (end2-start2)*pred / pred_count;
+- int end3 = start2 + (end2-start2)*(pred+1) / pred_count;
++ for (pred = 0; pred < pred_count; pred++) {
++ int start3 = start2 + (end2 - start2) * pred / pred_count;
++ int end3 = start2 + (end2 - start2) * (pred + 1) / pred_count;
+
+- for(index=start3; index<end3; index++){
+- FrameCode *ft= &nut->frame_code[index];
+- ft->flags= FLAG_KEY*key_frame;
+- ft->flags|= FLAG_SIZE_MSB;
+- ft->stream_id= stream_id;
++ for (index = start3; index < end3; index++) {
++ FrameCode *ft = &nut->frame_code[index];
++ ft->flags = FLAG_KEY * key_frame;
++ ft->flags |= FLAG_SIZE_MSB;
++ ft->stream_id = stream_id;
+ //FIXME use single byte size and pred from last
+- ft->size_mul= end3-start3;
+- ft->size_lsb= index - start3;
+- ft->pts_delta= pred_table[pred];
+- if(is_audio)
+- ft->header_idx= find_header_idx(s, codec, -1, key_frame);
++ ft->size_mul = end3 - start3;
++ ft->size_lsb = index - start3;
++ ft->pts_delta = pred_table[pred];
++ if (is_audio)
++ ft->header_idx = find_header_idx(s, codec, -1, key_frame);
+ }
+ }
+ }
+- memmove(&nut->frame_code['N'+1], &nut->frame_code['N'], sizeof(FrameCode)*(255-'N'));
+- nut->frame_code[ 0].flags=
+- nut->frame_code[255].flags=
+- nut->frame_code['N'].flags= FLAG_INVALID;
++ memmove(&nut->frame_code['N' + 1], &nut->frame_code['N'],
++ sizeof(FrameCode) * (255 - 'N'));
++ nut->frame_code[0].flags =
++ nut->frame_code[255].flags =
++ nut->frame_code['N'].flags = FLAG_INVALID;
+ }
+
+-static void put_tt(NUTContext *nut, AVRational *time_base, AVIOContext *bc, uint64_t val){
++static void put_tt(NUTContext *nut, AVRational *time_base, AVIOContext *bc,
++ uint64_t val)
++{
+ val *= nut->time_base_count;
+ val += time_base - nut->time_base;
+ ff_put_v(bc, val);
+ }
+-
+ /**
+ * Store a string as vb.
+ */
+-static void put_str(AVIOContext *bc, const char *string){
+- int len= strlen(string);
++static void put_str(AVIOContext *bc, const char *string)
++{
++ int len = strlen(string);
+
+ ff_put_v(bc, len);
+ avio_write(bc, string, len);
+ }
+
+-static void put_s(AVIOContext *bc, int64_t val){
+- ff_put_v(bc, 2*FFABS(val) - (val>0));
++static void put_s(AVIOContext *bc, int64_t val)
++{
++ ff_put_v(bc, 2 * FFABS(val) - (val > 0));
+ }
+
+ #ifdef TRACE
+@@ -279,29 +293,33 @@ static inline void put_s_trace(AVIOContext *bc, int64_t v, const char *file,
+ #endif
+
+ //FIXME remove calculate_checksum
+-static void put_packet(NUTContext *nut, AVIOContext *bc, AVIOContext *dyn_bc, int calculate_checksum, uint64_t startcode){
+- uint8_t *dyn_buf=NULL;
+- int dyn_size= avio_close_dyn_buf(dyn_bc, &dyn_buf);
+- int forw_ptr= dyn_size + 4*calculate_checksum;
++static void put_packet(NUTContext *nut, AVIOContext *bc, AVIOContext *dyn_bc,
++ int calculate_checksum, uint64_t startcode)
++{
++ uint8_t *dyn_buf = NULL;
++ int dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf);
++ int forw_ptr = dyn_size + 4 * calculate_checksum;
+
+- if(forw_ptr > 4096)
++ if (forw_ptr > 4096)
+ ffio_init_checksum(bc, ff_crc04C11DB7_update, 0);
+ avio_wb64(bc, startcode);
+ ff_put_v(bc, forw_ptr);
+- if(forw_ptr > 4096)
++ if (forw_ptr > 4096)
+ avio_wl32(bc, ffio_get_checksum(bc));
+
+- if(calculate_checksum)
++ if (calculate_checksum)
+ ffio_init_checksum(bc, ff_crc04C11DB7_update, 0);
+ avio_write(bc, dyn_buf, dyn_size);
+- if(calculate_checksum)
++ if (calculate_checksum)
+ avio_wl32(bc, ffio_get_checksum(bc));
+
+ av_free(dyn_buf);
+ }
+
+-static void write_mainheader(NUTContext *nut, AVIOContext *bc){
+- int i, j, tmp_pts, tmp_flags, tmp_stream, tmp_mul, tmp_size, tmp_fields, tmp_head_idx;
++static void write_mainheader(NUTContext *nut, AVIOContext *bc)
++{
++ int i, j, tmp_pts, tmp_flags, tmp_stream, tmp_mul, tmp_size, tmp_fields,
++ tmp_head_idx;
+ int64_t tmp_match;
+
+ ff_put_v(bc, 3); /* version */
+@@ -309,79 +327,104 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc){
+ ff_put_v(bc, nut->max_distance);
+ ff_put_v(bc, nut->time_base_count);
+
+- for(i=0; i<nut->time_base_count; i++){
++ for (i = 0; i < nut->time_base_count; i++) {
+ ff_put_v(bc, nut->time_base[i].num);
+ ff_put_v(bc, nut->time_base[i].den);
+ }
+
+- tmp_pts=0;
+- tmp_mul=1;
+- tmp_stream=0;
+- tmp_match= 1-(1LL<<62);
+- tmp_head_idx= 0;
+- for(i=0; i<256;){
+- tmp_fields=0;
+- tmp_size=0;
++ tmp_pts = 0;
++ tmp_mul = 1;
++ tmp_stream = 0;
++ tmp_match = 1 - (1LL << 62);
++ tmp_head_idx = 0;
++ for (i = 0; i < 256; ) {
++ tmp_fields = 0;
++ tmp_size = 0;
+ // tmp_res=0;
+- if(tmp_pts != nut->frame_code[i].pts_delta) tmp_fields=1;
+- if(tmp_mul != nut->frame_code[i].size_mul ) tmp_fields=2;
+- if(tmp_stream != nut->frame_code[i].stream_id) tmp_fields=3;
+- if(tmp_size != nut->frame_code[i].size_lsb ) tmp_fields=4;
++ if (tmp_pts != nut->frame_code[i].pts_delta)
++ tmp_fields = 1;
++ if (tmp_mul != nut->frame_code[i].size_mul)
++ tmp_fields = 2;
++ if (tmp_stream != nut->frame_code[i].stream_id)
++ tmp_fields = 3;
++ if (tmp_size != nut->frame_code[i].size_lsb)
++ tmp_fields = 4;
+ // if(tmp_res != nut->frame_code[i].res ) tmp_fields=5;
+- if(tmp_head_idx!=nut->frame_code[i].header_idx)tmp_fields=8;
+-
+- tmp_pts = nut->frame_code[i].pts_delta;
+- tmp_flags = nut->frame_code[i].flags;
+- tmp_stream= nut->frame_code[i].stream_id;
+- tmp_mul = nut->frame_code[i].size_mul;
+- tmp_size = nut->frame_code[i].size_lsb;
++ if (tmp_head_idx != nut->frame_code[i].header_idx)
++ tmp_fields = 8;
++
++ tmp_pts = nut->frame_code[i].pts_delta;
++ tmp_flags = nut->frame_code[i].flags;
++ tmp_stream = nut->frame_code[i].stream_id;
++ tmp_mul = nut->frame_code[i].size_mul;
++ tmp_size = nut->frame_code[i].size_lsb;
+ // tmp_res = nut->frame_code[i].res;
+- tmp_head_idx= nut->frame_code[i].header_idx;
++ tmp_head_idx = nut->frame_code[i].header_idx;
+
+- for(j=0; i<256; j++,i++){
+- if(i == 'N'){
++ for (j = 0; i < 256; j++, i++) {
++ if (i == 'N') {
+ j--;
+ continue;
+ }
+- if(nut->frame_code[i].pts_delta != tmp_pts ) break;
+- if(nut->frame_code[i].flags != tmp_flags ) break;
+- if(nut->frame_code[i].stream_id != tmp_stream) break;
+- if(nut->frame_code[i].size_mul != tmp_mul ) break;
+- if(nut->frame_code[i].size_lsb != tmp_size+j) break;
+-// if(nut->frame_code[i].res != tmp_res ) break;
+- if(nut->frame_code[i].header_idx!= tmp_head_idx) break;
++ if (nut->frame_code[i].pts_delta != tmp_pts ||
++ nut->frame_code[i].flags != tmp_flags ||
++ nut->frame_code[i].stream_id != tmp_stream ||
++ nut->frame_code[i].size_mul != tmp_mul ||
++ nut->frame_code[i].size_lsb != tmp_size + j ||
++// nut->frame_code[i].res != tmp_res ||
++ nut->frame_code[i].header_idx != tmp_head_idx)
++ break;
+ }
+- if(j != tmp_mul - tmp_size) tmp_fields=6;
++ if (j != tmp_mul - tmp_size)
++ tmp_fields = 6;
+
+ ff_put_v(bc, tmp_flags);
+ ff_put_v(bc, tmp_fields);
+- if(tmp_fields>0) put_s(bc, tmp_pts);
+- if(tmp_fields>1) ff_put_v(bc, tmp_mul);
+- if(tmp_fields>2) ff_put_v(bc, tmp_stream);
+- if(tmp_fields>3) ff_put_v(bc, tmp_size);
+- if(tmp_fields>4) ff_put_v(bc, 0 /*tmp_res*/);
+- if(tmp_fields>5) ff_put_v(bc, j);
+- if(tmp_fields>6) ff_put_v(bc, tmp_match);
+- if(tmp_fields>7) ff_put_v(bc, tmp_head_idx);
++ if (tmp_fields > 0)
++ put_s(bc, tmp_pts);
++ if (tmp_fields > 1)
++ ff_put_v(bc, tmp_mul);
++ if (tmp_fields > 2)
++ ff_put_v(bc, tmp_stream);
++ if (tmp_fields > 3)
++ ff_put_v(bc, tmp_size);
++ if (tmp_fields > 4)
++ ff_put_v(bc, 0 /*tmp_res*/);
++ if (tmp_fields > 5)
++ ff_put_v(bc, j);
++ if (tmp_fields > 6)
++ ff_put_v(bc, tmp_match);
++ if (tmp_fields > 7)
++ ff_put_v(bc, tmp_head_idx);
+ }
+- ff_put_v(bc, nut->header_count-1);
+- for(i=1; i<nut->header_count; i++){
++ ff_put_v(bc, nut->header_count - 1);
++ for (i = 1; i < nut->header_count; i++) {
+ ff_put_v(bc, nut->header_len[i]);
+ avio_write(bc, nut->header[i], nut->header_len[i]);
+ }
+ }
+
+-static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){
+- NUTContext *nut = avctx->priv_data;
++static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc,
++ AVStream *st, int i)
++{
++ NUTContext *nut = avctx->priv_data;
+ AVCodecContext *codec = st->codec;
+- unsigned codec_tag = av_codec_get_tag(ff_nut_codec_tags, codec->codec_id);
++ unsigned codec_tag = av_codec_get_tag(ff_nut_codec_tags, codec->codec_id);
+
+ ff_put_v(bc, i);
+- switch(codec->codec_type){
+- case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break;
+- case AVMEDIA_TYPE_AUDIO: ff_put_v(bc, 1); break;
+- case AVMEDIA_TYPE_SUBTITLE: ff_put_v(bc, 2); break;
+- default : ff_put_v(bc, 3); break;
++ switch (codec->codec_type) {
++ case AVMEDIA_TYPE_VIDEO:
++ ff_put_v(bc, 0);
++ break;
++ case AVMEDIA_TYPE_AUDIO:
++ ff_put_v(bc, 1);
++ break;
++ case AVMEDIA_TYPE_SUBTITLE:
++ ff_put_v(bc, 2);
++ break;
++ default:
++ ff_put_v(bc, 3);
++ break;
+ }
+ ff_put_v(bc, 4);
+
+@@ -404,7 +447,7 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream
+ ff_put_v(bc, codec->extradata_size);
+ avio_write(bc, codec->extradata, codec->extradata_size);
+
+- switch(codec->codec_type){
++ switch (codec->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ ff_put_v(bc, codec->sample_rate);
+ ff_put_v(bc, 1);
+@@ -414,10 +457,11 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream
+ ff_put_v(bc, codec->width);
+ ff_put_v(bc, codec->height);
+
+- if(st->sample_aspect_ratio.num<=0 || st->sample_aspect_ratio.den<=0){
++ if (st->sample_aspect_ratio.num <= 0 ||
++ st->sample_aspect_ratio.den <= 0) {
+ ff_put_v(bc, 0);
+ ff_put_v(bc, 0);
+- }else{
++ } else {
+ ff_put_v(bc, st->sample_aspect_ratio.num);
+ ff_put_v(bc, st->sample_aspect_ratio.den);
+ }
+@@ -429,21 +473,23 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream
+ return 0;
+ }
+
+-static int add_info(AVIOContext *bc, const char *type, const char *value){
++static int add_info(AVIOContext *bc, const char *type, const char *value)
++{
+ put_str(bc, type);
+ put_s(bc, -1);
+ put_str(bc, value);
+ return 1;
+ }
+
+-static int write_globalinfo(NUTContext *nut, AVIOContext *bc){
+- AVFormatContext *s= nut->avf;
++static int write_globalinfo(NUTContext *nut, AVIOContext *bc)
++{
++ AVFormatContext *s = nut->avf;
+ AVDictionaryEntry *t = NULL;
+ AVIOContext *dyn_bc;
+- uint8_t *dyn_buf=NULL;
+- int count=0, dyn_size;
+- int ret = avio_open_dyn_buf(&dyn_bc);
+- if(ret < 0)
++ uint8_t *dyn_buf = NULL;
++ int count = 0, dyn_size;
++ int ret = avio_open_dyn_buf(&dyn_bc);
++ if (ret < 0)
+ return ret;
+
+ while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
+@@ -456,7 +502,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc){
+
+ ff_put_v(bc, count);
+
+- dyn_size= avio_close_dyn_buf(dyn_bc, &dyn_buf);
++ dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf);
+ avio_write(bc, dyn_buf, dyn_size);
+ av_free(dyn_buf);
+ return 0;
+@@ -496,9 +542,9 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id){
+ static int write_chapter(NUTContext *nut, AVIOContext *bc, int id)
+ {
+ AVIOContext *dyn_bc;
+- uint8_t *dyn_buf = NULL;
++ uint8_t *dyn_buf = NULL;
+ AVDictionaryEntry *t = NULL;
+- AVChapter *ch = nut->avf->chapters[id];
++ AVChapter *ch = nut->avf->chapters[id];
+ int ret, dyn_size, count = 0;
+
+ ret = avio_open_dyn_buf(&dyn_bc);
+@@ -521,7 +567,8 @@ static int write_chapter(NUTContext *nut, AVIOContext *bc, int id)
+ return 0;
+ }
+
+-static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
++static int write_headers(AVFormatContext *avctx, AVIOContext *bc)
++{
+ NUTContext *nut = avctx->priv_data;
+ AVIOContext *dyn_bc;
+ int i, ret;
+@@ -529,29 +576,30 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
+ ff_metadata_conv_ctx(avctx, ff_nut_metadata_conv, NULL);
+
+ ret = avio_open_dyn_buf(&dyn_bc);
+- if(ret < 0)
++ if (ret < 0)
+ return ret;
+ write_mainheader(nut, dyn_bc);
+ put_packet(nut, bc, dyn_bc, 1, MAIN_STARTCODE);
+
+- for (i=0; i < nut->avf->nb_streams; i++){
++ for (i = 0; i < nut->avf->nb_streams; i++) {
+ ret = avio_open_dyn_buf(&dyn_bc);
+- if(ret < 0)
++ if (ret < 0)
+ return ret;
+- if ((ret = write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i)) < 0)
++ ret = write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i);
++ if (ret < 0)
+ return ret;
+ put_packet(nut, bc, dyn_bc, 1, STREAM_STARTCODE);
+ }
+
+ ret = avio_open_dyn_buf(&dyn_bc);
+- if(ret < 0)
++ if (ret < 0)
+ return ret;
+ write_globalinfo(nut, dyn_bc);
+ put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
+
+ for (i = 0; i < nut->avf->nb_streams; i++) {
+ ret = avio_open_dyn_buf(&dyn_bc);
+- if(ret < 0)
++ if (ret < 0)
+ return ret;
+ ret = write_streaminfo(nut, dyn_bc, i);
+ if (ret < 0)
+@@ -559,7 +607,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
+ if (ret > 0)
+ put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
+ else {
+- uint8_t* buf;
++ uint8_t *buf;
+ avio_close_dyn_buf(dyn_bc, &buf);
+ av_free(buf);
+ }
+@@ -579,22 +627,23 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
+ put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
+ }
+
+- nut->last_syncpoint_pos= INT_MIN;
++ nut->last_syncpoint_pos = INT_MIN;
+ nut->header_count++;
+ return 0;
+ }
+
+-static int nut_write_header(AVFormatContext *s){
++static int nut_write_header(AVFormatContext *s)
++{
+ NUTContext *nut = s->priv_data;
+ AVIOContext *bc = s->pb;
+ int i, j, ret;
+
+- nut->avf= s;
++ nut->avf = s;
+
+- nut->stream = av_mallocz(sizeof(StreamContext)*s->nb_streams);
++ nut->stream = av_mallocz(sizeof(StreamContext) * s->nb_streams);
+ if (s->nb_chapters)
+- nut->chapter = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
+- nut->time_base= av_mallocz(sizeof(AVRational )*(s->nb_streams +
++ nut->chapter = av_mallocz(sizeof(ChapterContext) * s->nb_chapters);
++ nut->time_base = av_mallocz(sizeof(AVRational) * (s->nb_streams +
+ s->nb_chapters));
+ if (!nut->stream || (s->nb_chapters && !nut->chapter) || !nut->time_base) {
+ av_freep(&nut->stream);
+@@ -603,42 +652,42 @@ static int nut_write_header(AVFormatContext *s){
+ return AVERROR(ENOMEM);
+ }
+
+- for(i=0; i<s->nb_streams; i++){
+- AVStream *st= s->streams[i];
++ for (i = 0; i < s->nb_streams; i++) {
++ AVStream *st = s->streams[i];
+ int ssize;
+ AVRational time_base;
+- ff_parse_specific_params(st->codec, &time_base.den, &ssize, &time_base.num);
++ ff_parse_specific_params(st->codec, &time_base.den, &ssize,
++ &time_base.num);
+
+ avpriv_set_pts_info(st, 64, time_base.num, time_base.den);
+
+- for(j=0; j<nut->time_base_count; j++){
+- if(!memcmp(&time_base, &nut->time_base[j], sizeof(AVRational))){
++ for (j = 0; j < nut->time_base_count; j++)
++ if (!memcmp(&time_base, &nut->time_base[j], sizeof(AVRational))) {
+ break;
+ }
+- }
+- nut->time_base[j]= time_base;
+- nut->stream[i].time_base= &nut->time_base[j];
+- if(j==nut->time_base_count)
++ nut->time_base[j] = time_base;
++ nut->stream[i].time_base = &nut->time_base[j];
++ if (j == nut->time_base_count)
+ nut->time_base_count++;
+
+- if(INT64_C(1000) * time_base.num >= time_base.den)
++ if (INT64_C(1000) * time_base.num >= time_base.den)
+ nut->stream[i].msb_pts_shift = 7;
+ else
+ nut->stream[i].msb_pts_shift = 14;
+- nut->stream[i].max_pts_distance= FFMAX(time_base.den, time_base.num) / time_base.num;
++ nut->stream[i].max_pts_distance =
++ FFMAX(time_base.den, time_base.num) / time_base.num;
+ }
+
+ for (i = 0; i < s->nb_chapters; i++) {
+ AVChapter *ch = s->chapters[i];
+
+- for (j = 0; j < nut->time_base_count; j++) {
++ for (j = 0; j < nut->time_base_count; j++)
+ if (!memcmp(&ch->time_base, &nut->time_base[j], sizeof(AVRational)))
+ break;
+- }
+
+- nut->time_base[j] = ch->time_base;
++ nut->time_base[j] = ch->time_base;
+ nut->chapter[i].time_base = &nut->time_base[j];
+- if(j == nut->time_base_count)
++ if (j == nut->time_base_count)
+ nut->time_base_count++;
+ }
+
+@@ -660,186 +709,207 @@ static int nut_write_header(AVFormatContext *s){
+ return 0;
+ }
+
+-static int get_needed_flags(NUTContext *nut, StreamContext *nus, FrameCode *fc, AVPacket *pkt){
+- int flags= 0;
+-
+- if(pkt->flags & AV_PKT_FLAG_KEY ) flags |= FLAG_KEY;
+- if(pkt->stream_index != fc->stream_id ) flags |= FLAG_STREAM_ID;
+- if(pkt->size / fc->size_mul ) flags |= FLAG_SIZE_MSB;
+- if(pkt->pts - nus->last_pts != fc->pts_delta) flags |= FLAG_CODED_PTS;
+- if(pkt->size > 2*nut->max_distance ) flags |= FLAG_CHECKSUM;
+- if(FFABS(pkt->pts - nus->last_pts)
+- > nus->max_pts_distance) flags |= FLAG_CHECKSUM;
+- if( pkt->size < nut->header_len[fc->header_idx]
+- || (pkt->size > 4096 && fc->header_idx)
+- || memcmp(pkt->data, nut->header[fc->header_idx], nut->header_len[fc->header_idx]))
+- flags |= FLAG_HEADER_IDX;
++static int get_needed_flags(NUTContext *nut, StreamContext *nus, FrameCode *fc,
++ AVPacket *pkt)
++{
++ int flags = 0;
++
++ if (pkt->flags & AV_PKT_FLAG_KEY)
++ flags |= FLAG_KEY;
++ if (pkt->stream_index != fc->stream_id)
++ flags |= FLAG_STREAM_ID;
++ if (pkt->size / fc->size_mul)
++ flags |= FLAG_SIZE_MSB;
++ if (pkt->pts - nus->last_pts != fc->pts_delta)
++ flags |= FLAG_CODED_PTS;
++ if (pkt->size > 2 * nut->max_distance)
++ flags |= FLAG_CHECKSUM;
++ if (FFABS(pkt->pts - nus->last_pts) > nus->max_pts_distance)
++ flags |= FLAG_CHECKSUM;
++ if (pkt->size < nut->header_len[fc->header_idx] ||
++ (pkt->size > 4096 && fc->header_idx) ||
++ memcmp(pkt->data, nut->header[fc->header_idx],
++ nut->header_len[fc->header_idx]))
++ flags |= FLAG_HEADER_IDX;
+
+ return flags | (fc->flags & FLAG_CODED);
+ }
+
+-static int find_best_header_idx(NUTContext *nut, AVPacket *pkt){
++static int find_best_header_idx(NUTContext *nut, AVPacket *pkt)
++{
+ int i;
+- int best_i = 0;
+- int best_len= 0;
++ int best_i = 0;
++ int best_len = 0;
+
+- if(pkt->size > 4096)
++ if (pkt->size > 4096)
+ return 0;
+
+- for(i=1; i<nut->header_count; i++){
+- if( pkt->size >= nut->header_len[i]
+- && nut->header_len[i] > best_len
+- && !memcmp(pkt->data, nut->header[i], nut->header_len[i])){
+- best_i= i;
+- best_len= nut->header_len[i];
++ for (i = 1; i < nut->header_count; i++)
++ if (pkt->size >= nut->header_len[i]
++ && nut->header_len[i] > best_len
++ && !memcmp(pkt->data, nut->header[i], nut->header_len[i])) {
++ best_i = i;
++ best_len = nut->header_len[i];
+ }
+- }
+ return best_i;
+ }
+
+-static int nut_write_packet(AVFormatContext *s, AVPacket *pkt){
+- NUTContext *nut = s->priv_data;
+- StreamContext *nus= &nut->stream[pkt->stream_index];
+- AVIOContext *bc = s->pb, *dyn_bc;
++static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
++{
++ NUTContext *nut = s->priv_data;
++ StreamContext *nus = &nut->stream[pkt->stream_index];
++ AVIOContext *bc = s->pb, *dyn_bc;
+ FrameCode *fc;
+ int64_t coded_pts;
+- int best_length, frame_code, flags, needed_flags, i, header_idx, best_header_idx;
++ int best_length, frame_code, flags, needed_flags, i, header_idx,
++ best_header_idx;
+ int key_frame = !!(pkt->flags & AV_PKT_FLAG_KEY);
+- int store_sp=0;
++ int store_sp = 0;
+ int ret;
+
+- if(pkt->pts < 0)
++ if (pkt->pts < 0)
+ return -1;
+
+- if(1LL<<(20+3*nut->header_count) <= avio_tell(bc))
++ if (1LL << (20 + 3 * nut->header_count) <= avio_tell(bc))
+ write_headers(s, bc);
+
+- if(key_frame && !(nus->last_flags & FLAG_KEY))
+- store_sp= 1;
++ if (key_frame && !(nus->last_flags & FLAG_KEY))
++ store_sp = 1;
+
+- if(pkt->size + 30/*FIXME check*/ + avio_tell(bc) >= nut->last_syncpoint_pos + nut->max_distance)
+- store_sp= 1;
++ if (pkt->size + 30 /*FIXME check*/ + avio_tell(bc) >=
++ nut->last_syncpoint_pos + nut->max_distance)
++ store_sp = 1;
+
+ //FIXME: Ensure store_sp is 1 in the first place.
+
+- if(store_sp){
+- Syncpoint *sp, dummy= {.pos= INT64_MAX};
++ if (store_sp) {
++ Syncpoint *sp, dummy = { .pos = INT64_MAX };
+
+ ff_nut_reset_ts(nut, *nus->time_base, pkt->dts);
+- for(i=0; i<s->nb_streams; i++){
+- AVStream *st= s->streams[i];
++ for (i = 0; i < s->nb_streams; i++) {
++ AVStream *st = s->streams[i];
+ int64_t dts_tb = av_rescale_rnd(pkt->dts,
+ nus->time_base->num * (int64_t)nut->stream[i].time_base->den,
+ nus->time_base->den * (int64_t)nut->stream[i].time_base->num,
+ AV_ROUND_DOWN);
+- int index= av_index_search_timestamp(st, dts_tb, AVSEEK_FLAG_BACKWARD);
+- if(index>=0) dummy.pos= FFMIN(dummy.pos, st->index_entries[index].pos);
++ int index = av_index_search_timestamp(st, dts_tb,
++ AVSEEK_FLAG_BACKWARD);
++ if (index >= 0)
++ dummy.pos = FFMIN(dummy.pos, st->index_entries[index].pos);
+ }
+- if(dummy.pos == INT64_MAX)
+- dummy.pos= 0;
+- sp= av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp,
+- NULL);
++ if (dummy.pos == INT64_MAX)
++ dummy.pos = 0;
++ sp = av_tree_find(nut->syncpoints, &dummy, (void *)ff_nut_sp_pos_cmp,
++ NULL);
+
+- nut->last_syncpoint_pos= avio_tell(bc);
+- ret = avio_open_dyn_buf(&dyn_bc);
+- if(ret < 0)
++ nut->last_syncpoint_pos = avio_tell(bc);
++ ret = avio_open_dyn_buf(&dyn_bc);
++ if (ret < 0)
+ return ret;
+ put_tt(nut, nus->time_base, dyn_bc, pkt->dts);
+- ff_put_v(dyn_bc, sp ? (nut->last_syncpoint_pos - sp->pos)>>4 : 0);
++ ff_put_v(dyn_bc, sp ? (nut->last_syncpoint_pos - sp->pos) >> 4 : 0);
+ put_packet(nut, bc, dyn_bc, 1, SYNCPOINT_STARTCODE);
+
+- ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0/*unused*/, pkt->dts);
++ ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts);
+ }
+ assert(nus->last_pts != AV_NOPTS_VALUE);
+
+- coded_pts = pkt->pts & ((1<<nus->msb_pts_shift)-1);
+- if(ff_lsb2full(nus, coded_pts) != pkt->pts)
+- coded_pts= pkt->pts + (1<<nus->msb_pts_shift);
++ coded_pts = pkt->pts & ((1 << nus->msb_pts_shift) - 1);
++ if (ff_lsb2full(nus, coded_pts) != pkt->pts)
++ coded_pts = pkt->pts + (1 << nus->msb_pts_shift);
+
+- best_header_idx= find_best_header_idx(nut, pkt);
++ best_header_idx = find_best_header_idx(nut, pkt);
+
+- best_length=INT_MAX;
+- frame_code= -1;
+- for(i=0; i<256; i++){
+- int length= 0;
+- FrameCode *fc= &nut->frame_code[i];
+- int flags= fc->flags;
++ best_length = INT_MAX;
++ frame_code = -1;
++ for (i = 0; i < 256; i++) {
++ int length = 0;
++ FrameCode *fc = &nut->frame_code[i];
++ int flags = fc->flags;
+
+- if(flags & FLAG_INVALID)
++ if (flags & FLAG_INVALID)
+ continue;
+- needed_flags= get_needed_flags(nut, nus, fc, pkt);
++ needed_flags = get_needed_flags(nut, nus, fc, pkt);
+
+- if(flags & FLAG_CODED){
++ if (flags & FLAG_CODED) {
+ length++;
+ flags = needed_flags;
+ }
+
+- if((flags & needed_flags) != needed_flags)
++ if ((flags & needed_flags) != needed_flags)
+ continue;
+
+- if((flags ^ needed_flags) & FLAG_KEY)
++ if ((flags ^ needed_flags) & FLAG_KEY)
+ continue;
+
+- if(flags & FLAG_STREAM_ID)
+- length+= ff_get_v_length(pkt->stream_index);
++ if (flags & FLAG_STREAM_ID)
++ length += ff_get_v_length(pkt->stream_index);
+
+- if(pkt->size % fc->size_mul != fc->size_lsb)
++ if (pkt->size % fc->size_mul != fc->size_lsb)
+ continue;
+- if(flags & FLAG_SIZE_MSB)
++ if (flags & FLAG_SIZE_MSB)
+ length += ff_get_v_length(pkt->size / fc->size_mul);
+
+- if(flags & FLAG_CHECKSUM)
+- length+=4;
++ if (flags & FLAG_CHECKSUM)
++ length += 4;
+
+- if(flags & FLAG_CODED_PTS)
++ if (flags & FLAG_CODED_PTS)
+ length += ff_get_v_length(coded_pts);
+
+- if( (flags & FLAG_CODED)
+- && nut->header_len[best_header_idx] > nut->header_len[fc->header_idx]+1){
++ if ((flags & FLAG_CODED)
++ && nut->header_len[best_header_idx] >
++ nut->header_len[fc->header_idx] + 1) {
+ flags |= FLAG_HEADER_IDX;
+ }
+
+- if(flags & FLAG_HEADER_IDX){
++ if (flags & FLAG_HEADER_IDX) {
+ length += 1 - nut->header_len[best_header_idx];
+- }else{
++ } else {
+ length -= nut->header_len[fc->header_idx];
+ }
+
+- length*=4;
+- length+= !(flags & FLAG_CODED_PTS);
+- length+= !(flags & FLAG_CHECKSUM);
++ length *= 4;
++ length += !(flags & FLAG_CODED_PTS);
++ length += !(flags & FLAG_CHECKSUM);
+
+- if(length < best_length){
+- best_length= length;
+- frame_code=i;
++ if (length < best_length) {
++ best_length = length;
++ frame_code = i;
+ }
+ }
+ assert(frame_code != -1);
+- fc= &nut->frame_code[frame_code];
+- flags= fc->flags;
+- needed_flags= get_needed_flags(nut, nus, fc, pkt);
+- header_idx= fc->header_idx;
++ fc = &nut->frame_code[frame_code];
++ flags = fc->flags;
++ needed_flags = get_needed_flags(nut, nus, fc, pkt);
++ header_idx = fc->header_idx;
+
+ ffio_init_checksum(bc, ff_crc04C11DB7_update, 0);
+ avio_w8(bc, frame_code);
+- if(flags & FLAG_CODED){
+- ff_put_v(bc, (flags^needed_flags) & ~(FLAG_CODED));
++ if (flags & FLAG_CODED) {
++ ff_put_v(bc, (flags ^ needed_flags) & ~(FLAG_CODED));
+ flags = needed_flags;
+ }
+- if(flags & FLAG_STREAM_ID) ff_put_v(bc, pkt->stream_index);
+- if(flags & FLAG_CODED_PTS) ff_put_v(bc, coded_pts);
+- if(flags & FLAG_SIZE_MSB) ff_put_v(bc, pkt->size / fc->size_mul);
+- if(flags & FLAG_HEADER_IDX) ff_put_v(bc, header_idx= best_header_idx);
+-
+- if(flags & FLAG_CHECKSUM) avio_wl32(bc, ffio_get_checksum(bc));
+- else ffio_get_checksum(bc);
++ if (flags & FLAG_STREAM_ID)
++ ff_put_v(bc, pkt->stream_index);
++ if (flags & FLAG_CODED_PTS)
++ ff_put_v(bc, coded_pts);
++ if (flags & FLAG_SIZE_MSB)
++ ff_put_v(bc, pkt->size / fc->size_mul);
++ if (flags & FLAG_HEADER_IDX)
++ ff_put_v(bc, header_idx = best_header_idx);
++
++ if (flags & FLAG_CHECKSUM)
++ avio_wl32(bc, ffio_get_checksum(bc));
++ else
++ ffio_get_checksum(bc);
+
+- avio_write(bc, pkt->data + nut->header_len[header_idx], pkt->size - nut->header_len[header_idx]);
+- nus->last_flags= flags;
+- nus->last_pts= pkt->pts;
++ avio_write(bc, pkt->data + nut->header_len[header_idx],
++ pkt->size - nut->header_len[header_idx]);
++ nus->last_flags = flags;
++ nus->last_pts = pkt->pts;
+
+ //FIXME just store one per syncpoint
+- if(flags & FLAG_KEY)
++ if (flags & FLAG_KEY)
+ av_add_index_entry(
+ s->streams[pkt->stream_index],
+ nut->last_syncpoint_pos,
+@@ -851,11 +921,12 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt){
+ return 0;
+ }
+
+-static int nut_write_trailer(AVFormatContext *s){
+- NUTContext *nut= s->priv_data;
+- AVIOContext *bc= s->pb;
++static int nut_write_trailer(AVFormatContext *s)
++{
++ NUTContext *nut = s->priv_data;
++ AVIOContext *bc = s->pb;
+
+- while(nut->header_count<3)
++ while (nut->header_count < 3)
+ write_headers(s, bc);
+
+ ff_nut_free_sp(nut);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0055-yuv4mpeg-reject-unsupported-codecs.patch b/debian/patches/post-9beta2/0055-yuv4mpeg-reject-unsupported-codecs.patch
new file mode 100644
index 0000000..1274fa9
--- /dev/null
+++ b/debian/patches/post-9beta2/0055-yuv4mpeg-reject-unsupported-codecs.patch
@@ -0,0 +1,30 @@
+From 424b1e764263b1493de4c34365ef367ddae856db Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Fri, 26 Oct 2012 22:55:04 +0200
+Subject: [PATCH 055/204] yuv4mpeg: reject unsupported codecs
+
+The muxer already rejects unsupported pixel formats, reject also
+unsupported codecs to prevent dangerous misuses.
+---
+ libavformat/yuv4mpeg.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
+index bdae17b..a8077a0 100644
+--- a/libavformat/yuv4mpeg.c
++++ b/libavformat/yuv4mpeg.c
+@@ -155,6 +155,11 @@ static int yuv4_write_header(AVFormatContext *s)
+ if (s->nb_streams != 1)
+ return AVERROR(EIO);
+
++ if (s->streams[0]->codec->codec_id != AV_CODEC_ID_RAWVIDEO) {
++ av_log(s, AV_LOG_ERROR, "ERROR: Only rawvideo supported.\n");
++ return AVERROR_INVALIDDATA;
++ }
++
+ if (s->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV411P) {
+ av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV "
+ "stream, some mjpegtools might not work.\n");
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0056-rtpdec-Cosmetic-cleanup.patch b/debian/patches/post-9beta2/0056-rtpdec-Cosmetic-cleanup.patch
new file mode 100644
index 0000000..cacc333
--- /dev/null
+++ b/debian/patches/post-9beta2/0056-rtpdec-Cosmetic-cleanup.patch
@@ -0,0 +1,215 @@
+From 48f01398ba30d8d921b27558df0029033e2d4402 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Mon, 22 Oct 2012 15:54:25 +0300
+Subject: [PATCH 056/204] rtpdec: Cosmetic cleanup
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Mainly clean up the RTP statistics code, plus a few other obviously
+misindentend lines.
+
+Remove some useless comments, de-doxygenize some comments,
+add spacing around operators and fix a typo.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavformat/rtpdec.c | 106 ++++++++++++++++++++++++--------------------------
+ 1 file changed, 51 insertions(+), 55 deletions(-)
+
+diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
+index 9a1c497..d16122d 100644
+--- a/libavformat/rtpdec.c
++++ b/libavformat/rtpdec.c
+@@ -166,71 +166,67 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int l
+
+ #define RTP_SEQ_MOD (1<<16)
+
+-/**
+-* called on parse open packet
+-*/
+-static void rtp_init_statistics(RTPStatistics *s, uint16_t base_sequence) // called on parse open packet.
++static void rtp_init_statistics(RTPStatistics *s, uint16_t base_sequence)
+ {
+ memset(s, 0, sizeof(RTPStatistics));
+- s->max_seq= base_sequence;
+- s->probation= 1;
++ s->max_seq = base_sequence;
++ s->probation = 1;
+ }
+
+-/**
++/*
+ * called whenever there is a large jump in sequence numbers, or when they get out of probation...
+ */
+ static void rtp_init_sequence(RTPStatistics *s, uint16_t seq)
+ {
+- s->max_seq= seq;
+- s->cycles= 0;
+- s->base_seq= seq -1;
+- s->bad_seq= RTP_SEQ_MOD + 1;
+- s->received= 0;
+- s->expected_prior= 0;
+- s->received_prior= 0;
+- s->jitter= 0;
+- s->transit= 0;
++ s->max_seq = seq;
++ s->cycles = 0;
++ s->base_seq = seq - 1;
++ s->bad_seq = RTP_SEQ_MOD + 1;
++ s->received = 0;
++ s->expected_prior = 0;
++ s->received_prior = 0;
++ s->jitter = 0;
++ s->transit = 0;
+ }
+
+-/**
++/*
+ * returns 1 if we should handle this packet.
+ */
+ static int rtp_valid_packet_in_sequence(RTPStatistics *s, uint16_t seq)
+ {
+- uint16_t udelta= seq - s->max_seq;
+- const int MAX_DROPOUT= 3000;
+- const int MAX_MISORDER = 100;
++ uint16_t udelta = seq - s->max_seq;
++ const int MAX_DROPOUT = 3000;
++ const int MAX_MISORDER = 100;
+ const int MIN_SEQUENTIAL = 2;
+
+ /* source not valid until MIN_SEQUENTIAL packets with sequence seq. numbers have been received */
+- if(s->probation)
+- {
+- if(seq==s->max_seq + 1) {
++ if (s->probation) {
++ if (seq == s->max_seq + 1) {
+ s->probation--;
+- s->max_seq= seq;
+- if(s->probation==0) {
++ s->max_seq = seq;
++ if (s->probation == 0) {
+ rtp_init_sequence(s, seq);
+ s->received++;
+ return 1;
+ }
+ } else {
+- s->probation= MIN_SEQUENTIAL - 1;
++ s->probation = MIN_SEQUENTIAL - 1;
+ s->max_seq = seq;
+ }
+ } else if (udelta < MAX_DROPOUT) {
+ // in order, with permissible gap
+- if(seq < s->max_seq) {
+- //sequence number wrapped; count antother 64k cycles
++ if (seq < s->max_seq) {
++ // sequence number wrapped; count another 64k cycles
+ s->cycles += RTP_SEQ_MOD;
+ }
+- s->max_seq= seq;
++ s->max_seq = seq;
+ } else if (udelta <= RTP_SEQ_MOD - MAX_MISORDER) {
+ // sequence made a large jump...
+- if(seq==s->bad_seq) {
++ if (seq == s->bad_seq) {
+ // two sequential packets-- assume that the other side restarted without telling us; just resync.
+ rtp_init_sequence(s, seq);
+ } else {
+- s->bad_seq= (seq + 1) & (RTP_SEQ_MOD-1);
++ s->bad_seq = (seq + 1) & (RTP_SEQ_MOD - 1);
+ return 0;
+ }
+ } else {
+@@ -246,7 +242,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
+ uint8_t *buf;
+ int len;
+ int rtcp_bytes;
+- RTPStatistics *stats= &s->statistics;
++ RTPStatistics *stats = &s->statistics;
+ uint32_t lost;
+ uint32_t extended_max;
+ uint32_t expected_interval;
+@@ -254,7 +250,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
+ uint32_t lost_interval;
+ uint32_t expected;
+ uint32_t fraction;
+- uint64_t ntp_time= s->last_rtcp_ntp_time; // TODO: Get local ntp time?
++ uint64_t ntp_time = s->last_rtcp_ntp_time; // TODO: Get local ntp time?
+
+ if (!s->rtp_ctx || (count < 1))
+ return -1;
+@@ -281,31 +277,32 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
+ avio_wb32(pb, s->ssrc); // server SSRC
+ // some placeholders we should really fill...
+ // RFC 1889/p64
+- extended_max= stats->cycles + stats->max_seq;
+- expected= extended_max - stats->base_seq + 1;
+- lost= expected - stats->received;
+- lost= FFMIN(lost, 0xffffff); // clamp it since it's only 24 bits...
+- expected_interval= expected - stats->expected_prior;
+- stats->expected_prior= expected;
+- received_interval= stats->received - stats->received_prior;
+- stats->received_prior= stats->received;
+- lost_interval= expected_interval - received_interval;
+- if (expected_interval==0 || lost_interval<=0) fraction= 0;
+- else fraction = (lost_interval<<8)/expected_interval;
+-
+- fraction= (fraction<<24) | lost;
++ extended_max = stats->cycles + stats->max_seq;
++ expected = extended_max - stats->base_seq + 1;
++ lost = expected - stats->received;
++ lost = FFMIN(lost, 0xffffff); // clamp it since it's only 24 bits...
++ expected_interval = expected - stats->expected_prior;
++ stats->expected_prior = expected;
++ received_interval = stats->received - stats->received_prior;
++ stats->received_prior = stats->received;
++ lost_interval = expected_interval - received_interval;
++ if (expected_interval == 0 || lost_interval <= 0)
++ fraction = 0;
++ else
++ fraction = (lost_interval << 8) / expected_interval;
++
++ fraction = (fraction << 24) | lost;
+
+ avio_wb32(pb, fraction); /* 8 bits of fraction, 24 bits of total packets lost */
+ avio_wb32(pb, extended_max); /* max sequence received */
+- avio_wb32(pb, stats->jitter>>4); /* jitter */
++ avio_wb32(pb, stats->jitter >> 4); /* jitter */
+
+- if(s->last_rtcp_ntp_time==AV_NOPTS_VALUE)
+- {
++ if (s->last_rtcp_ntp_time == AV_NOPTS_VALUE) {
+ avio_wb32(pb, 0); /* last SR timestamp */
+ avio_wb32(pb, 0); /* delay since last SR */
+ } else {
+- uint32_t middle_32_bits= s->last_rtcp_ntp_time>>16; // this is valid, right? do we need to handle 64 bit values special?
+- uint32_t delay_since_last= ntp_time - s->last_rtcp_ntp_time;
++ uint32_t middle_32_bits = s->last_rtcp_ntp_time >> 16; // this is valid, right? do we need to handle 64 bit values special?
++ uint32_t delay_since_last = ntp_time - s->last_rtcp_ntp_time;
+
+ avio_wb32(pb, middle_32_bits); /* last SR timestamp */
+ avio_wb32(pb, delay_since_last); /* delay since last SR */
+@@ -431,9 +428,8 @@ RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext
+ return s;
+ }
+
+-void
+-ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
+- RTPDynamicProtocolHandler *handler)
++void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
++ RTPDynamicProtocolHandler *handler)
+ {
+ s->dynamic_protocol_context = ctx;
+ s->parse_packet = handler->parse_packet;
+@@ -671,7 +667,7 @@ static int rtp_parse_queued_packet(RTPDemuxContext *s, AVPacket *pkt)
+ }
+
+ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
+- uint8_t **bufptr, int len)
++ uint8_t **bufptr, int len)
+ {
+ uint8_t* buf = bufptr ? *bufptr : NULL;
+ int ret, flags = 0;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0057-lavc-add-CODEC_CAP_DR1-to-all-video-decoders-missing.patch b/debian/patches/post-9beta2/0057-lavc-add-CODEC_CAP_DR1-to-all-video-decoders-missing.patch
new file mode 100644
index 0000000..d6a8e92
--- /dev/null
+++ b/debian/patches/post-9beta2/0057-lavc-add-CODEC_CAP_DR1-to-all-video-decoders-missing.patch
@@ -0,0 +1,111 @@
+From f174fbac3cb127273b8f3df8e05d7156ec1d7658 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 17 Oct 2012 21:39:04 +0200
+Subject: [PATCH 057/204] lavc: add CODEC_CAP_DR1 to all video decoders
+ missing them
+
+---
+ libavcodec/bink.c | 1 +
+ libavcodec/dpx.c | 1 +
+ libavcodec/indeo3.c | 1 +
+ libavcodec/indeo4.c | 1 +
+ libavcodec/indeo5.c | 1 +
+ libavcodec/kgv1dec.c | 1 +
+ libavcodec/sgidec.c | 1 +
+ libavcodec/vb.c | 1 +
+ libavcodec/yop.c | 1 +
+ 9 files changed, 9 insertions(+)
+
+diff --git a/libavcodec/bink.c b/libavcodec/bink.c
+index b6c8c4b..636bb20 100644
+--- a/libavcodec/bink.c
++++ b/libavcodec/bink.c
+@@ -1336,4 +1336,5 @@ AVCodec ff_bink_decoder = {
+ .close = decode_end,
+ .decode = decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("Bink video"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
+index f1a4e86..55f71c9 100644
+--- a/libavcodec/dpx.c
++++ b/libavcodec/dpx.c
+@@ -243,4 +243,5 @@ AVCodec ff_dpx_decoder = {
+ .close = decode_end,
+ .decode = decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("DPX image"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
+index fc0d2bc..322d360 100644
+--- a/libavcodec/indeo3.c
++++ b/libavcodec/indeo3.c
+@@ -1114,4 +1114,5 @@ AVCodec ff_indeo3_decoder = {
+ .decode = decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
+index b837ffb..2eebc26 100644
+--- a/libavcodec/indeo4.c
++++ b/libavcodec/indeo4.c
+@@ -607,4 +607,5 @@ AVCodec ff_indeo4_decoder = {
+ .close = ff_ivi_decode_close,
+ .decode = ff_ivi_decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 4"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c
+index e9f7733..dc5f6f0 100644
+--- a/libavcodec/indeo5.c
++++ b/libavcodec/indeo5.c
+@@ -642,4 +642,5 @@ AVCodec ff_indeo5_decoder = {
+ .close = ff_ivi_decode_close,
+ .decode = ff_ivi_decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 5"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c
+index 8f32943..bd362bf 100644
+--- a/libavcodec/kgv1dec.c
++++ b/libavcodec/kgv1dec.c
+@@ -191,4 +191,5 @@ AVCodec ff_kgv1_decoder = {
+ .decode = decode_frame,
+ .flush = decode_flush,
+ .long_name = NULL_IF_CONFIG_SMALL("Kega Game Video"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
+index c220452..412709c 100644
+--- a/libavcodec/sgidec.c
++++ b/libavcodec/sgidec.c
+@@ -267,4 +267,5 @@ AVCodec ff_sgi_decoder = {
+ .close = sgi_end,
+ .decode = decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+diff --git a/libavcodec/vb.c b/libavcodec/vb.c
+index 39e14a0..13f965d 100644
+--- a/libavcodec/vb.c
++++ b/libavcodec/vb.c
+@@ -275,4 +275,5 @@ AVCodec ff_vb_decoder = {
+ .close = decode_end,
+ .decode = decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+diff --git a/libavcodec/yop.c b/libavcodec/yop.c
+index cda9cad..f1ab525 100644
+--- a/libavcodec/yop.c
++++ b/libavcodec/yop.c
+@@ -256,4 +256,5 @@ AVCodec ff_yop_decoder = {
+ .close = yop_decode_close,
+ .decode = yop_decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"),
++ .capabilities = CODEC_CAP_DR1,
+ };
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0058-nutenc-verbosely-report-unsupported-negative-pts.patch b/debian/patches/post-9beta2/0058-nutenc-verbosely-report-unsupported-negative-pts.patch
new file mode 100644
index 0000000..24b9478
--- /dev/null
+++ b/debian/patches/post-9beta2/0058-nutenc-verbosely-report-unsupported-negative-pts.patch
@@ -0,0 +1,32 @@
+From 07585ffa62eebebcd35326935fec7cd948021daf Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Sat, 27 Oct 2012 16:56:37 +0200
+Subject: [PATCH 058/204] nutenc: verbosely report unsupported negative pts
+
+Additionally use the correct error number.
+---
+ libavformat/nutenc.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
+index 581a202..e9e313b 100644
+--- a/libavformat/nutenc.c
++++ b/libavformat/nutenc.c
+@@ -767,8 +767,12 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
+ int store_sp = 0;
+ int ret;
+
+- if (pkt->pts < 0)
+- return -1;
++ if (pkt->pts < 0) {
++ av_log(s, AV_LOG_ERROR,
++ "Negative pts not supported stream %d, pts %"PRId64"\n",
++ pkt->stream_index, pkt->pts);
++ return AVERROR_INVALIDDATA;
++ }
+
+ if (1LL << (20 + 3 * nut->header_count) <= avio_tell(bc))
+ write_headers(s, bc);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0059-nut-support-textual-data.patch b/debian/patches/post-9beta2/0059-nut-support-textual-data.patch
new file mode 100644
index 0000000..21d75ac
--- /dev/null
+++ b/debian/patches/post-9beta2/0059-nut-support-textual-data.patch
@@ -0,0 +1,82 @@
+From d4bff9f1ab59f4ae58841bd7b056f2ff1b8854d7 Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Thu, 25 Oct 2012 14:05:40 +0200
+Subject: [PATCH 059/204] nut: support textual data
+
+Plain text (utf8 encoded) data can be muxed and demuxed in nut.
+---
+ doc/nut.texi | 6 ++++++
+ libavformat/nut.c | 7 ++++++-
+ libavformat/nut.h | 1 +
+ libavformat/nutdec.c | 1 +
+ 4 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/doc/nut.texi b/doc/nut.texi
+index 1c23934..9b84241 100644
+--- a/doc/nut.texi
++++ b/doc/nut.texi
+@@ -66,6 +66,12 @@ PFD[32] would for example be signed 32 bit little-endian IEEE float
+ @item DVBS @tab DVB subtitles
+ @end multitable
+
++ at section Raw Data
++
++ at multitable @columnfractions .4 .4
++ at item UTF8 @tab Raw UTF-8
++ at end multitable
++
+ @section Codecs
+
+ @multitable @columnfractions .4 .4
+diff --git a/libavformat/nut.c b/libavformat/nut.c
+index e367d1c..85b126b 100644
+--- a/libavformat/nut.c
++++ b/libavformat/nut.c
+@@ -33,6 +33,11 @@ const AVCodecTag ff_nut_subtitle_tags[] = {
+ { AV_CODEC_ID_NONE , 0 }
+ };
+
++const AVCodecTag ff_nut_data_tags[] = {
++ { AV_CODEC_ID_TEXT , MKTAG('U', 'T', 'F', '8') },
++ { AV_CODEC_ID_NONE , 0 }
++};
++
+ const AVCodecTag ff_nut_video_tags[] = {
+ { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 15 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 15 ) },
+@@ -117,7 +122,7 @@ const AVCodecTag ff_nut_audio_tags[] = {
+
+ const AVCodecTag * const ff_nut_codec_tags[] = {
+ ff_nut_video_tags, ff_nut_audio_tags, ff_nut_subtitle_tags,
+- ff_codec_bmp_tags, ff_codec_wav_tags, 0
++ ff_codec_bmp_tags, ff_codec_wav_tags, ff_nut_data_tags, 0
+ };
+
+ void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){
+diff --git a/libavformat/nut.h b/libavformat/nut.h
+index a91a109..5f624eb 100644
+--- a/libavformat/nut.h
++++ b/libavformat/nut.h
+@@ -106,6 +106,7 @@ typedef struct NUTContext {
+ extern const AVCodecTag ff_nut_subtitle_tags[];
+ extern const AVCodecTag ff_nut_video_tags[];
+ extern const AVCodecTag ff_nut_audio_tags[];
++extern const AVCodecTag ff_nut_data_tags[];
+
+ extern const AVCodecTag * const ff_nut_codec_tags[];
+
+diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
+index 9b1891f..9ce0519 100644
+--- a/libavformat/nutdec.c
++++ b/libavformat/nutdec.c
+@@ -371,6 +371,7 @@ static int decode_stream_header(NUTContext *nut)
+ break;
+ case 3:
+ st->codec->codec_type = AVMEDIA_TYPE_DATA;
++ st->codec->codec_id = ff_codec_get_id(ff_nut_data_tags, tmp);
+ break;
+ default:
+ av_log(s, AV_LOG_ERROR, "unknown stream class (%d)\n", class);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0060-rtsp-Avoid-a-cast-when-calling-strtol.patch b/debian/patches/post-9beta2/0060-rtsp-Avoid-a-cast-when-calling-strtol.patch
new file mode 100644
index 0000000..21b4dab
--- /dev/null
+++ b/debian/patches/post-9beta2/0060-rtsp-Avoid-a-cast-when-calling-strtol.patch
@@ -0,0 +1,37 @@
+From f21d5c905dd5c6a56583c85623a376a029ec041a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Mon, 22 Oct 2012 23:13:49 +0300
+Subject: [PATCH 060/204] rtsp: Avoid a cast when calling strtol
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This gets rid of this warning:
+
+libavformat/rtsp.c: In function ‘rtsp_parse_transport’:
+libavformat/rtsp.c:794: warning: cast discards qualifiers from pointer target type
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavformat/rtsp.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
+index bbe08e6..44de4af 100644
+--- a/libavformat/rtsp.c
++++ b/libavformat/rtsp.c
+@@ -765,8 +765,10 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
+ th->lower_transport = RTSP_LOWER_TRANSPORT_UDP_MULTICAST;
+ } else if (!strcmp(parameter, "ttl")) {
+ if (*p == '=') {
++ char *end;
+ p++;
+- th->ttl = strtol(p, (char **)&p, 10);
++ th->ttl = strtol(p, &end, 10);
++ p = end;
+ }
+ } else if (!strcmp(parameter, "destination")) {
+ if (*p == '=') {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0061-aacenc-Drop-some-unused-function-arguments.patch b/debian/patches/post-9beta2/0061-aacenc-Drop-some-unused-function-arguments.patch
new file mode 100644
index 0000000..13de7c3
--- /dev/null
+++ b/debian/patches/post-9beta2/0061-aacenc-Drop-some-unused-function-arguments.patch
@@ -0,0 +1,53 @@
+From 72c758f1fd06e812a2075bae836ec18891d99852 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 19:16:08 +0200
+Subject: [PATCH 061/204] aacenc: Drop some unused function arguments
+
+---
+ libavcodec/aacenc.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
+index f5ab40f..e9f6e2f 100644
+--- a/libavcodec/aacenc.c
++++ b/libavcodec/aacenc.c
+@@ -302,7 +302,7 @@ static void encode_ms_info(PutBitContext *pb, ChannelElement *cpe)
+ /**
+ * Produce integer coefficients from scalefactors provided by the model.
+ */
+-static void adjust_frame_information(AACEncContext *apc, ChannelElement *cpe, int chans)
++static void adjust_frame_information(ChannelElement *cpe, int chans)
+ {
+ int i, w, w2, g, ch;
+ int start, maxsfb, cmaxsfb;
+@@ -460,8 +460,7 @@ static int encode_individual_channel(AVCodecContext *avctx, AACEncContext *s,
+ /**
+ * Write some auxiliary information about the created AAC file.
+ */
+-static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s,
+- const char *name)
++static void put_bitstream_info(AACEncContext *s, const char *name)
+ {
+ int i, namelen, padbits;
+
+@@ -584,7 +583,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+ init_put_bits(&s->pb, avpkt->data, avpkt->size);
+
+ if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & CODEC_FLAG_BITEXACT))
+- put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
++ put_bitstream_info(s, LIBAVCODEC_IDENT);
+ start_ch = 0;
+ memset(chan_el_counter, 0, sizeof(chan_el_counter));
+ for (i = 0; i < s->chan_map[0]; i++) {
+@@ -626,7 +625,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+ s->coder->search_for_ms(s, cpe, s->lambda);
+ }
+ }
+- adjust_frame_information(s, cpe, chans);
++ adjust_frame_information(cpe, chans);
+ if (chans == 2) {
+ put_bits(&s->pb, 1, cpe->common_window);
+ if (cpe->common_window) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0062-cmdutils-Conditionally-compile-libswscale-related-bi.patch b/debian/patches/post-9beta2/0062-cmdutils-Conditionally-compile-libswscale-related-bi.patch
new file mode 100644
index 0000000..9109724
--- /dev/null
+++ b/debian/patches/post-9beta2/0062-cmdutils-Conditionally-compile-libswscale-related-bi.patch
@@ -0,0 +1,46 @@
+From ab799664755c8bc2c439c428ff5b538c105a5c38 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Mon, 29 Oct 2012 18:00:14 +0100
+Subject: [PATCH 062/204] cmdutils: Conditionally compile libswscale-related
+ bits
+
+This fixes compilation with libswscale disabled.
+---
+ cmdutils.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/cmdutils.c b/cmdutils.c
+index 6570968..630301f 100644
+--- a/cmdutils.c
++++ b/cmdutils.c
+@@ -371,7 +371,10 @@ int opt_default(void *optctx, const char *opt, const char *arg)
+ const AVOption *o;
+ char opt_stripped[128];
+ const char *p;
+- const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(), *sc = sws_get_class();
++ const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
++#if CONFIG_SWSCALE
++ const AVClass *sc = sws_get_class();
++#endif
+
+ if (!(p = strchr(opt, ':')))
+ p = opt + strlen(opt);
+@@ -385,6 +388,7 @@ int opt_default(void *optctx, const char *opt, const char *arg)
+ else if ((o = av_opt_find(&fc, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))
+ av_dict_set(&format_opts, opt, arg, FLAGS);
++#if CONFIG_SWSCALE
+ else if ((o = av_opt_find(&sc, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
+ // XXX we only support sws_flags, not arbitrary sws options
+@@ -394,6 +398,7 @@ int opt_default(void *optctx, const char *opt, const char *arg)
+ return ret;
+ }
+ }
++#endif
+
+ if (o)
+ return 0;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0063-avconv-Drop-unused-function-argument-from-do_video_s.patch b/debian/patches/post-9beta2/0063-avconv-Drop-unused-function-argument-from-do_video_s.patch
new file mode 100644
index 0000000..0c539f0
--- /dev/null
+++ b/debian/patches/post-9beta2/0063-avconv-Drop-unused-function-argument-from-do_video_s.patch
@@ -0,0 +1,36 @@
+From 70478746a94eba6467c02f1c2ae8d8090ad9168e Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 19:18:12 +0200
+Subject: [PATCH 063/204] avconv: Drop unused function argument from
+ do_video_stats()
+
+---
+ avconv.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/avconv.c b/avconv.c
+index 54a0e2a..d0902a6 100644
+--- a/avconv.c
++++ b/avconv.c
+@@ -621,8 +621,7 @@ static double psnr(double d)
+ return -10.0 * log(d) / log(10.0);
+ }
+
+-static void do_video_stats(AVFormatContext *os, OutputStream *ost,
+- int frame_size)
++static void do_video_stats(OutputStream *ost, int frame_size)
+ {
+ AVCodecContext *enc;
+ int frame_number;
+@@ -706,7 +705,7 @@ static int poll_filter(OutputStream *ost)
+
+ do_video_out(of->ctx, ost, filtered_frame, &frame_size);
+ if (vstats_filename && frame_size)
+- do_video_stats(of->ctx, ost, frame_size);
++ do_video_stats(ost, frame_size);
+ break;
+ case AVMEDIA_TYPE_AUDIO:
+ do_audio_out(of->ctx, ost, filtered_frame);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0064-fate-Add-shorthands-for-acodec-PCM-and-ADPCM-tests.patch b/debian/patches/post-9beta2/0064-fate-Add-shorthands-for-acodec-PCM-and-ADPCM-tests.patch
new file mode 100644
index 0000000..77e9b78
--- /dev/null
+++ b/debian/patches/post-9beta2/0064-fate-Add-shorthands-for-acodec-PCM-and-ADPCM-tests.patch
@@ -0,0 +1,38 @@
+From e519990ced06467ea3be249d0267205758a375eb Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 17 Oct 2012 19:47:03 +0200
+Subject: [PATCH 064/204] fate: Add shorthands for acodec PCM and ADPCM tests
+
+---
+ tests/fate/acodec.mak | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
+index 609559c..531f2f3 100644
+--- a/tests/fate/acodec.mak
++++ b/tests/fate/acodec.mak
+@@ -18,7 +18,9 @@ FATE_ACODEC_PCM-$(call ENCDEC, PCM_F32LE, WAV) += f32le
+ FATE_ACODEC_PCM-$(call ENCDEC, PCM_F64BE, AU) += f64be
+ FATE_ACODEC_PCM-$(call ENCDEC, PCM_F64LE, WAV) += f64le
+
+-FATE_ACODEC += $(FATE_ACODEC_PCM-yes:%=fate-acodec-pcm-%)
++FATE_ACODEC_PCM := $(FATE_ACODEC_PCM-yes:%=fate-acodec-pcm-%)
++FATE_AVCONV += $(FATE_ACODEC_PCM)
++fate-acodec-pcm: $(FATE_ACODEC_PCM)
+
+ fate-acodec-pcm-%: FMT = wav
+ fate-acodec-pcm-%: CODEC = pcm_$(@:fate-acodec-pcm-%=%)
+@@ -34,7 +36,9 @@ FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_MS, WAV) += ms
+ FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_SWF, FLV) += swf
+ FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_YAMAHA, WAV) += yamaha
+
+-FATE_ACODEC += $(FATE_ACODEC_ADPCM-yes:%=fate-acodec-adpcm-%)
++FATE_ACODEC_ADPCM := $(FATE_ACODEC_ADPCM-yes:%=fate-acodec-adpcm-%)
++FATE_AVCONV += $(FATE_ACODEC_ADPCM)
++fate-acodec-adpcm: $(FATE_ACODEC_ADPCM)
+
+ fate-acodec-adpcm-%: CODEC = adpcm_$(@:fate-acodec-adpcm-%=%)
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0065-fate-ac3-Place-E-AC-3-tests-and-AC-3-tests-in-differ.patch b/debian/patches/post-9beta2/0065-fate-ac3-Place-E-AC-3-tests-and-AC-3-tests-in-differ.patch
new file mode 100644
index 0000000..4670890
--- /dev/null
+++ b/debian/patches/post-9beta2/0065-fate-ac3-Place-E-AC-3-tests-and-AC-3-tests-in-differ.patch
@@ -0,0 +1,74 @@
+From 381dc1a5ec0925b281c573457c413ae643567086 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sat, 20 Oct 2012 00:14:26 +0200
+Subject: [PATCH 065/204] fate: ac3: Place E-AC-3 tests and AC-3 tests in
+ different groups
+
+---
+ tests/fate/ac3.mak | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/tests/fate/ac3.mak b/tests/fate/ac3.mak
+index b2bfb8e..235414d 100644
+--- a/tests/fate/ac3.mak
++++ b/tests/fate/ac3.mak
+@@ -26,23 +26,23 @@ FATE_AC3 += fate-ac3-5.1-downmix-stereo
+ fate-ac3-5.1-downmix-stereo: CMD = pcm -request_channels 2 -i $(SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3
+ fate-ac3-5.1-downmix-stereo: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small_stereo.pcm
+
+-FATE_AC3 += fate-eac3-1
++FATE_EAC3 += fate-eac3-1
+ fate-eac3-1: CMD = pcm -i $(SAMPLES)/eac3/csi_miami_5.1_256_spx_small.eac3
+ fate-eac3-1: REF = $(SAMPLES)/eac3/csi_miami_5.1_256_spx_small.pcm
+
+-FATE_AC3 += fate-eac3-2
++FATE_EAC3 += fate-eac3-2
+ fate-eac3-2: CMD = pcm -i $(SAMPLES)/eac3/csi_miami_stereo_128_spx_small.eac3
+ fate-eac3-2: REF = $(SAMPLES)/eac3/csi_miami_stereo_128_spx_small.pcm
+
+-FATE_AC3 += fate-eac3-3
++FATE_EAC3 += fate-eac3-3
+ fate-eac3-3: CMD = pcm -i $(SAMPLES)/eac3/matrix2_commentary1_stereo_192_small.eac3
+ fate-eac3-3: REF = $(SAMPLES)/eac3/matrix2_commentary1_stereo_192_small.pcm
+
+-FATE_AC3 += fate-eac3-4
++FATE_EAC3 += fate-eac3-4
+ fate-eac3-4: CMD = pcm -i $(SAMPLES)/eac3/serenity_english_5.1_1536_small.eac3
+ fate-eac3-4: REF = $(SAMPLES)/eac3/serenity_english_5.1_1536_small.pcm
+
+-$(FATE_AC3): CMP = oneoff
++$(FATE_AC3) $(FATE_EAC3): CMP = oneoff
+
+ FATE_AC3_ENCODE += fate-ac3-encode
+ fate-ac3-encode: CMD = enc_dec_pcm ac3 wav s16le $(REF) -c:a ac3 -b:a 128k
+@@ -51,7 +51,7 @@ fate-ac3-encode: CMP_TARGET = 399.62
+ fate-ac3-encode: SIZE_TOLERANCE = 488
+ fate-ac3-encode: FUZZ = 3
+
+-FATE_AC3_ENCODE += fate-eac3-encode
++FATE_EAC3_ENCODE += fate-eac3-encode
+ fate-eac3-encode: CMD = enc_dec_pcm eac3 wav s16le $(REF) -c:a eac3 -b:a 128k
+ fate-eac3-encode: CMP_SHIFT = -1024
+ fate-eac3-encode: CMP_TARGET = 514.02
+@@ -61,12 +61,15 @@ fate-eac3-encode: FUZZ = 3
+ fate-ac3-encode fate-eac3-encode: CMP = stddev
+ fate-ac3-encode fate-eac3-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
+
+-FATE_AC3_ENCODE += fate-ac3-fixed-encode
++FATE_AC3_FIXED_ENCODE += fate-ac3-fixed-encode
+ fate-ac3-fixed-encode: tests/data/asynth-44100-2.wav
+ fate-ac3-fixed-encode: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
+ fate-ac3-fixed-encode: CMD = md5 -i $(SRC) -c ac3_fixed -b 128k -f ac3 -flags bitexact
+ fate-ac3-fixed-encode: CMP = oneline
+ fate-ac3-fixed-encode: REF = a1d1fc116463b771abf5aef7ed37d7b1
+
+-FATE_SAMPLES_AVCONV += $(FATE_AC3) $(FATE_AC3_ENCODE)
+-fate-ac3: $(FATE_AC3) $(FATE_AC3_ENCODE)
++FATE_SAMPLES_AVCONV += $(FATE_AC3) $(FATE_AC3_ENCODE) $(FATE_AC3_FIXED_ENCODE)
++FATE_SAMPLES_AVCONV += $(FATE_EAC3) $(FATE_EAC3_ENCODE)
++
++fate-ac3: $(FATE_AC3) $(FATE_AC3_ENCODE) $(FATE_AC3_FIXED_ENCODE)
++fate-ac3: $(FATE_EAC3) $(FATE_EAC3_ENCODE)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0066-fate-ac3-Add-dependencies.patch b/debian/patches/post-9beta2/0066-fate-ac3-Add-dependencies.patch
new file mode 100644
index 0000000..94179f0
--- /dev/null
+++ b/debian/patches/post-9beta2/0066-fate-ac3-Add-dependencies.patch
@@ -0,0 +1,55 @@
+From 2cbdd7c92958cb8226491d8eb23ed2d57d4b841e Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sat, 20 Oct 2012 01:13:39 +0200
+Subject: [PATCH 066/204] fate: ac3: Add dependencies
+
+---
+ tests/fate/ac3.mak | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/tests/fate/ac3.mak b/tests/fate/ac3.mak
+index 235414d..59d0780 100644
+--- a/tests/fate/ac3.mak
++++ b/tests/fate/ac3.mak
+@@ -44,14 +44,17 @@ fate-eac3-4: REF = $(SAMPLES)/eac3/serenity_english_5.1_1536_small.pcm
+
+ $(FATE_AC3) $(FATE_EAC3): CMP = oneoff
+
+-FATE_AC3_ENCODE += fate-ac3-encode
++FATE_AC3-$(call DEMDEC, AC3, AC3) += $(FATE_AC3)
++FATE_EAC3-$(call DEMDEC, EAC3, EAC3) += $(FATE_EAC3)
++
++FATE_AC3-$(call ENCDEC, AC3, AC3) += fate-ac3-encode
+ fate-ac3-encode: CMD = enc_dec_pcm ac3 wav s16le $(REF) -c:a ac3 -b:a 128k
+ fate-ac3-encode: CMP_SHIFT = -1024
+ fate-ac3-encode: CMP_TARGET = 399.62
+ fate-ac3-encode: SIZE_TOLERANCE = 488
+ fate-ac3-encode: FUZZ = 3
+
+-FATE_EAC3_ENCODE += fate-eac3-encode
++FATE_EAC3-$(call ENCDEC, EAC3, EAC3) += fate-eac3-encode
+ fate-eac3-encode: CMD = enc_dec_pcm eac3 wav s16le $(REF) -c:a eac3 -b:a 128k
+ fate-eac3-encode: CMP_SHIFT = -1024
+ fate-eac3-encode: CMP_TARGET = 514.02
+@@ -61,15 +64,13 @@ fate-eac3-encode: FUZZ = 3
+ fate-ac3-encode fate-eac3-encode: CMP = stddev
+ fate-ac3-encode fate-eac3-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
+
+-FATE_AC3_FIXED_ENCODE += fate-ac3-fixed-encode
++FATE_AC3-$(call ENCMUX, AC3_FIXED, AC3) += fate-ac3-fixed-encode
+ fate-ac3-fixed-encode: tests/data/asynth-44100-2.wav
+ fate-ac3-fixed-encode: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
+ fate-ac3-fixed-encode: CMD = md5 -i $(SRC) -c ac3_fixed -b 128k -f ac3 -flags bitexact
+ fate-ac3-fixed-encode: CMP = oneline
+ fate-ac3-fixed-encode: REF = a1d1fc116463b771abf5aef7ed37d7b1
+
+-FATE_SAMPLES_AVCONV += $(FATE_AC3) $(FATE_AC3_ENCODE) $(FATE_AC3_FIXED_ENCODE)
+-FATE_SAMPLES_AVCONV += $(FATE_EAC3) $(FATE_EAC3_ENCODE)
++FATE_SAMPLES_AVCONV- += $(FATE_AC3-yes) $(FATE_EAC3-yes)
+
+-fate-ac3: $(FATE_AC3) $(FATE_AC3_ENCODE) $(FATE_AC3_FIXED_ENCODE)
+-fate-ac3: $(FATE_EAC3) $(FATE_EAC3_ENCODE)
++fate-ac3: $(FATE_AC3-yes) $(FATE_EAC3-yes)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0067-indeo3-remove-duplicate-capabilities-line.patch b/debian/patches/post-9beta2/0067-indeo3-remove-duplicate-capabilities-line.patch
new file mode 100644
index 0000000..27629d1
--- /dev/null
+++ b/debian/patches/post-9beta2/0067-indeo3-remove-duplicate-capabilities-line.patch
@@ -0,0 +1,22 @@
+From bff5e5f8b3c5892a21a0df7b3352b31511e42a94 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Mon, 29 Oct 2012 12:16:05 +0100
+Subject: [PATCH 067/204] indeo3: remove duplicate capabilities line.
+
+---
+ libavcodec/indeo3.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
+index 322d360..fc0d2bc 100644
+--- a/libavcodec/indeo3.c
++++ b/libavcodec/indeo3.c
+@@ -1114,5 +1114,4 @@ AVCodec ff_indeo3_decoder = {
+ .decode = decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"),
+- .capabilities = CODEC_CAP_DR1,
+ };
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0068-lavr-add-general-API-usage-doxy.patch b/debian/patches/post-9beta2/0068-lavr-add-general-API-usage-doxy.patch
new file mode 100644
index 0000000..05802f2
--- /dev/null
+++ b/debian/patches/post-9beta2/0068-lavr-add-general-API-usage-doxy.patch
@@ -0,0 +1,116 @@
+From 01b760190d32550683d7c790309acadea3fe0820 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Sun, 28 Oct 2012 22:52:54 +0100
+Subject: [PATCH 068/204] lavr: add general API usage doxy
+
+Signed-off-by: Anton Khirnov <anton at khirnov.net>
+---
+ libavresample/avresample.h | 71 ++++++++++++++++++++++++++++++++++++++++++++
+ libavutil/avutil.h | 1 +
+ 2 files changed, 72 insertions(+)
+
+diff --git a/libavresample/avresample.h b/libavresample/avresample.h
+index ea93952..87134b3 100644
+--- a/libavresample/avresample.h
++++ b/libavresample/avresample.h
+@@ -23,9 +23,76 @@
+
+ /**
+ * @file
++ * @ingroup lavr
+ * external API header
+ */
+
++/**
++ * @defgroup lavr Libavresample
++ * @{
++ *
++ * Libavresample (lavr) is a library that handles audio resampling, sample
++ * format conversion and mixing.
++ *
++ * Interaction with lavr is done through AVAudioResampleContext, which is
++ * allocated with avresample_alloc_context(). It is opaque, so all parameters
++ * must be set with the @ref avoptions API.
++ *
++ * For example the following code will setup conversion from planar float sample
++ * format to interleaved signed 16-bit integer, downsampling from 48kHz to
++ * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
++ * matrix):
++ * @code
++ * AVAudioResampleContext *avr = avresample_alloc_context();
++ * av_opt_set_int(avr, "in_channel_layout", AV_CH_LAYOUT_5POINT1, 0);
++ * av_opt_set_int(avr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
++ * av_opt_set_int(avr, "in_sample_rate", 48000, 0);
++ * av_opt_set_int(avr, "out_sample_rate", 44100, 0);
++ * av_opt_set_int(avr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
++ * av_opt_set_int(avr, "out_sample_fmt, AV_SAMPLE_FMT_S16, 0);
++ * @endcode
++ *
++ * Once the context is initialized, it must be opened with avresample_open(). If
++ * you need to change the conversion parameters, you must close the context with
++ * avresample_close(), change the parameters as described above, then reopen it
++ * again.
++ *
++ * The conversion itself is done by repeatedly calling avresample_convert().
++ * Note that the samples may get buffered in two places in lavr. The first one
++ * is the output FIFO, where the samples end up if the output buffer is not
++ * large enough. The data stored in there may be retrieved at any time with
++ * avresample_read(). The second place is the resampling delay buffer,
++ * applicable only when resampling is done. The samples in it require more input
++ * before they can be processed. Their current amount is returned by
++ * avresample_get_delay(). At the end of conversion the resampling buffer can be
++ * flushed by calling avresample_convert() with NULL input.
++ *
++ * The following code demonstrates the conversion loop assuming the parameters
++ * from above and caller-defined functions get_input() and handle_output():
++ * @code
++ * uint8_t **input;
++ * int in_linesize, in_samples;
++ *
++ * while (get_input(&input, &in_linesize, &in_samples)) {
++ * uint8_t *output
++ * int out_linesize;
++ * int out_samples = avresample_available(avr) +
++ * av_rescale_rnd(avresample_get_delay(avr) +
++ * in_samples, 44100, 48000, AV_ROUND_UP);
++ * av_samples_alloc(&output, &out_linesize, 2, out_samples,
++ * AV_SAMPLE_FMT_S16, 0);
++ * out_samples = avresample_convert(avr, &output, out_linesize, out_samples,
++ * input, in_linesize, in_samples);
++ * handle_output(output, out_linesize, out_samples);
++ * av_freep(&output);
++ * }
++ * @endcode
++ *
++ * When the conversion is finished and the FIFOs are flushed if required, the
++ * conversion context and everything associated with it must be freed with
++ * avresample_free().
++ */
++
+ #include "libavutil/audioconvert.h"
+ #include "libavutil/avutil.h"
+ #include "libavutil/dict.h"
+@@ -289,4 +356,8 @@ int avresample_available(AVAudioResampleContext *avr);
+ */
+ int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples);
+
++/**
++ * @}
++ */
++
+ #endif /* AVRESAMPLE_AVRESAMPLE_H */
+diff --git a/libavutil/avutil.h b/libavutil/avutil.h
+index a1433b4..33f9bea 100644
+--- a/libavutil/avutil.h
++++ b/libavutil/avutil.h
+@@ -39,6 +39,7 @@
+ * @li @ref libavf "libavformat" I/O and muxing/demuxing library
+ * @li @ref lavd "libavdevice" special devices muxing/demuxing library
+ * @li @ref lavu "libavutil" common utility library
++ * @li @ref lavr "libavresample" audio resampling, format conversion and mixing
+ * @li @subpage libswscale color conversion and scaling library
+ */
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0069-lavr-document-upper-bound-on-number-of-output-sample.patch b/debian/patches/post-9beta2/0069-lavr-document-upper-bound-on-number-of-output-sample.patch
new file mode 100644
index 0000000..c352dc1
--- /dev/null
+++ b/debian/patches/post-9beta2/0069-lavr-document-upper-bound-on-number-of-output-sample.patch
@@ -0,0 +1,29 @@
+From dc5793062e7a0f6d195fc403d7ce242729b4ea4a Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Sun, 28 Oct 2012 22:52:55 +0100
+Subject: [PATCH 069/204] lavr: document upper bound on number of output
+ samples.
+
+Signed-off-by: Anton Khirnov <anton at khirnov.net>
+---
+ libavresample/avresample.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libavresample/avresample.h b/libavresample/avresample.h
+index 87134b3..b0a9e24 100644
+--- a/libavresample/avresample.h
++++ b/libavresample/avresample.h
+@@ -265,6 +265,10 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
+ /**
+ * Convert input samples and write them to the output FIFO.
+ *
++ * The upper bound on the number of output samples is given by
++ * avresample_available() + (avresample_get_delay() + number of input samples) *
++ * output sample rate / input sample rate.
++ *
+ * The output data can be NULL or have fewer allocated samples than required.
+ * In this case, any remaining samples not written to the output will be added
+ * to an internal FIFO buffer, to be returned at the next call to this function
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0070-lpc-Add-a-function-for-calculating-reflection-coeffi.patch b/debian/patches/post-9beta2/0070-lpc-Add-a-function-for-calculating-reflection-coeffi.patch
new file mode 100644
index 0000000..8e16eda
--- /dev/null
+++ b/debian/patches/post-9beta2/0070-lpc-Add-a-function-for-calculating-reflection-coeffi.patch
@@ -0,0 +1,59 @@
+From 39ef66f5300c2a42acc29937f5417bc2efe09752 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sat, 27 Oct 2012 22:29:56 +0300
+Subject: [PATCH 070/204] lpc: Add a function for calculating reflection
+ coefficients from autocorrelation coefficients
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavcodec/lpc.h | 31 +++++++++++++++++++++++++++++++
+ 1 file changed, 31 insertions(+)
+
+diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h
+index cbee46f..0e54f0d 100644
+--- a/libavcodec/lpc.h
++++ b/libavcodec/lpc.h
+@@ -111,6 +111,37 @@ void ff_lpc_end(LPCContext *s);
+ #endif
+
+ /**
++ * Schur recursion.
++ * Produces reflection coefficients from autocorrelation data.
++ */
++static inline void compute_ref_coefs(const LPC_TYPE *autoc, int max_order,
++ LPC_TYPE *ref, LPC_TYPE *error)
++{
++ int i, j;
++ LPC_TYPE err;
++ LPC_TYPE gen0[MAX_LPC_ORDER], gen1[MAX_LPC_ORDER];
++
++ for (i = 0; i < max_order; i++)
++ gen0[i] = gen1[i] = autoc[i + 1];
++
++ err = autoc[0];
++ ref[0] = -gen1[0] / err;
++ err += gen1[0] * ref[0];
++ if (error)
++ error[0] = err;
++ for (i = 1; i < max_order; i++) {
++ for (j = 0; j < max_order - i; j++) {
++ gen1[j] = gen1[j + 1] + ref[i - 1] * gen0[j];
++ gen0[j] = gen1[j + 1] * ref[i - 1] + gen0[j];
++ }
++ ref[i] = -gen1[0] / err;
++ err += gen1[0] * ref[i];
++ if (error)
++ error[i] = err;
++ }
++}
++
++/**
+ * Levinson-Durbin recursion.
+ * Produce LPC coefficients from autocorrelation data.
+ */
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0071-lpc-Add-a-function-for-calculating-reflection-coeffi.patch b/debian/patches/post-9beta2/0071-lpc-Add-a-function-for-calculating-reflection-coeffi.patch
new file mode 100644
index 0000000..30182e8
--- /dev/null
+++ b/debian/patches/post-9beta2/0071-lpc-Add-a-function-for-calculating-reflection-coeffi.patch
@@ -0,0 +1,55 @@
+From 8b25a20efbf4ca261bcd3327a385330eca775ec6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Thu, 25 Oct 2012 15:33:15 +0300
+Subject: [PATCH 071/204] lpc: Add a function for calculating reflection
+ coefficients from samples
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavcodec/lpc.c | 12 ++++++++++++
+ libavcodec/lpc.h | 3 +++
+ 2 files changed, 15 insertions(+)
+
+diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
+index 126dbc1..2093e7e 100644
+--- a/libavcodec/lpc.c
++++ b/libavcodec/lpc.c
+@@ -148,6 +148,18 @@ static int estimate_best_order(double *ref, int min_order, int max_order)
+ return est;
+ }
+
++int ff_lpc_calc_ref_coefs(LPCContext *s,
++ const int32_t *samples, int order, double *ref)
++{
++ double autoc[MAX_LPC_ORDER + 1];
++
++ s->lpc_apply_welch_window(samples, s->blocksize, s->windowed_samples);
++ s->lpc_compute_autocorr(s->windowed_samples, s->blocksize, order, autoc);
++ compute_ref_coefs(autoc, order, ref, NULL);
++
++ return order;
++}
++
+ /**
+ * Calculate LPC coefficients for multiple orders
+ *
+diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h
+index 0e54f0d..6590608 100644
+--- a/libavcodec/lpc.h
++++ b/libavcodec/lpc.h
+@@ -92,6 +92,9 @@ int ff_lpc_calc_coefs(LPCContext *s,
+ enum FFLPCType lpc_type, int lpc_passes,
+ int omethod, int max_shift, int zero_shift);
+
++int ff_lpc_calc_ref_coefs(LPCContext *s,
++ const int32_t *samples, int order, double *ref);
++
+ /**
+ * Initialize LPCContext.
+ */
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0072-avcodec-Add-a-RFC-3389-comfort-noise-codec.patch b/debian/patches/post-9beta2/0072-avcodec-Add-a-RFC-3389-comfort-noise-codec.patch
new file mode 100644
index 0000000..8fea7fd
--- /dev/null
+++ b/debian/patches/post-9beta2/0072-avcodec-Add-a-RFC-3389-comfort-noise-codec.patch
@@ -0,0 +1,401 @@
+From 9b500b8f6c9806f3979f9d1fb874b7f4a802c656 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 23 Oct 2012 00:02:41 +0300
+Subject: [PATCH 072/204] avcodec: Add a RFC 3389 comfort noise codec
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This isn't too useful as a normal codec, but can be used in
+voip style applications. The decoder updates the noise
+generator parameters when a packet is given to it for decoding,
+but if called with an empty packet, it generates more noise
+according to the last parameters.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ configure | 1 +
+ libavcodec/Makefile | 2 +
+ libavcodec/allcodecs.c | 1 +
+ libavcodec/avcodec.h | 1 +
+ libavcodec/cngdec.c | 162 +++++++++++++++++++++++++++++++++++++++++++++++
+ libavcodec/cngenc.c | 116 +++++++++++++++++++++++++++++++++
+ libavcodec/codec_desc.c | 7 ++
+ libavcodec/version.h | 2 +-
+ 8 files changed, 291 insertions(+), 1 deletion(-)
+ create mode 100644 libavcodec/cngdec.c
+ create mode 100644 libavcodec/cngenc.c
+
+diff --git a/configure b/configure
+index 1a006be..2abc465 100755
+--- a/configure
++++ b/configure
+@@ -1440,6 +1440,7 @@ atrac3_decoder_select="mdct"
+ binkaudio_dct_decoder_select="mdct rdft dct sinewin"
+ binkaudio_rdft_decoder_select="mdct rdft sinewin"
+ cavs_decoder_select="golomb mpegvideo"
++comfortnoise_encoder_select="lpc"
+ cook_decoder_select="mdct sinewin"
+ cscd_decoder_select="lzo"
+ cscd_decoder_suggest="zlib"
+diff --git a/libavcodec/Makefile b/libavcodec/Makefile
+index d8c853a..4d14aea 100644
+--- a/libavcodec/Makefile
++++ b/libavcodec/Makefile
+@@ -129,6 +129,8 @@ OBJS-$(CONFIG_CLJR_DECODER) += cljr.o
+ OBJS-$(CONFIG_CLJR_ENCODER) += cljr.o
+ OBJS-$(CONFIG_CLLC_DECODER) += cllc.o
+ OBJS-$(CONFIG_COOK_DECODER) += cook.o
++OBJS-$(CONFIG_COMFORTNOISE_DECODER) += cngdec.o celp_filters.o
++OBJS-$(CONFIG_COMFORTNOISE_ENCODER) += cngenc.o
+ OBJS-$(CONFIG_CSCD_DECODER) += cscd.o
+ OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
+ OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \
+diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
+index b175fbb..e5fb351 100644
+--- a/libavcodec/allcodecs.c
++++ b/libavcodec/allcodecs.c
+@@ -91,6 +91,7 @@ void avcodec_register_all(void)
+ REGISTER_DECODER (CINEPAK, cinepak);
+ REGISTER_ENCDEC (CLJR, cljr);
+ REGISTER_DECODER (CLLC, cllc);
++ REGISTER_ENCDEC (COMFORTNOISE, comfortnoise);
+ REGISTER_DECODER (CSCD, cscd);
+ REGISTER_DECODER (CYUV, cyuv);
+ REGISTER_DECODER (DFA, dfa);
+diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
+index c505a92..d6a4e4d 100644
+--- a/libavcodec/avcodec.h
++++ b/libavcodec/avcodec.h
+@@ -406,6 +406,7 @@ enum AVCodecID {
+ AV_CODEC_ID_IAC,
+ AV_CODEC_ID_ILBC,
+ AV_CODEC_ID_OPUS,
++ AV_CODEC_ID_COMFORT_NOISE,
+
+ /* subtitle codecs */
+ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
+diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c
+new file mode 100644
+index 0000000..c22fd55
+--- /dev/null
++++ b/libavcodec/cngdec.c
+@@ -0,0 +1,162 @@
++/*
++ * RFC 3389 comfort noise generator
++ * Copyright (c) 2012 Martin Storsjo
++ *
++ * This file is part of Libav.
++ *
++ * Libav is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * Libav is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with Libav; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#include <math.h>
++
++#include "libavutil/common.h"
++#include "avcodec.h"
++#include "celp_filters.h"
++#include "libavutil/lfg.h"
++
++typedef struct CNGContext {
++ AVFrame avframe;
++ float *refl_coef, *target_refl_coef;
++ float *lpc_coef;
++ int order;
++ int energy, target_energy;
++ float *filter_out;
++ float *excitation;
++ AVLFG lfg;
++} CNGContext;
++
++static av_cold int cng_decode_close(AVCodecContext *avctx)
++{
++ CNGContext *p = avctx->priv_data;
++ av_free(p->refl_coef);
++ av_free(p->target_refl_coef);
++ av_free(p->lpc_coef);
++ av_free(p->filter_out);
++ av_free(p->excitation);
++ return 0;
++}
++
++static av_cold int cng_decode_init(AVCodecContext *avctx)
++{
++ CNGContext *p = avctx->priv_data;
++
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 1;
++ avctx->sample_rate = 8000;
++
++ avcodec_get_frame_defaults(&p->avframe);
++ avctx->coded_frame = &p->avframe;
++ p->order = 12;
++ avctx->frame_size = 640;
++ p->refl_coef = av_mallocz(p->order * sizeof(*p->refl_coef));
++ p->target_refl_coef = av_mallocz(p->order * sizeof(*p->target_refl_coef));
++ p->lpc_coef = av_mallocz(p->order * sizeof(*p->lpc_coef));
++ p->filter_out = av_mallocz((avctx->frame_size + p->order) *
++ sizeof(*p->filter_out));
++ p->excitation = av_mallocz(avctx->frame_size * sizeof(*p->excitation));
++ if (!p->refl_coef || !p->target_refl_coef || !p->lpc_coef ||
++ !p->filter_out || !p->excitation) {
++ cng_decode_close(avctx);
++ return AVERROR(ENOMEM);
++ }
++
++ av_lfg_init(&p->lfg, 0);
++
++ return 0;
++}
++
++static void make_lpc_coefs(float *lpc, const float *refl, int order)
++{
++ float buf[100];
++ float *next, *cur;
++ int m, i;
++ next = buf;
++ cur = lpc;
++ for (m = 0; m < order; m++) {
++ next[m] = refl[m];
++ for (i = 0; i < m; i++)
++ next[i] = cur[i] + refl[m] * cur[m - i - 1];
++ FFSWAP(float*, next, cur);
++ }
++ if (cur != lpc)
++ memcpy(lpc, cur, sizeof(*lpc) * order);
++}
++
++static int cng_decode_frame(AVCodecContext *avctx, void *data,
++ int *got_frame_ptr, AVPacket *avpkt)
++{
++
++ CNGContext *p = avctx->priv_data;
++ int buf_size = avpkt->size;
++ int ret, i;
++ int16_t *buf_out;
++ float e = 1.0;
++ float scaling;
++
++ if (avpkt->size) {
++ float dbov = -avpkt->data[0] / 10.0;
++ p->target_energy = 1081109975 * pow(10, dbov) * 0.75;
++ memset(p->target_refl_coef, 0, sizeof(p->refl_coef));
++ for (i = 0; i < FFMIN(avpkt->size - 1, p->order); i++) {
++ p->target_refl_coef[i] = (avpkt->data[1 + i] - 127) / 128.0;
++ }
++ make_lpc_coefs(p->lpc_coef, p->refl_coef, p->order);
++ }
++
++ p->energy = p->energy / 2 + p->target_energy / 2;
++ for (i = 0; i < p->order; i++)
++ p->refl_coef[i] = 0.6 *p->refl_coef[i] + 0.4 * p->target_refl_coef[i];
++
++ for (i = 0; i < p->order; i++)
++ e *= 1.0 - p->refl_coef[i]*p->refl_coef[i];
++
++ scaling = sqrt(e * p->energy / 1081109975);
++ for (i = 0; i < avctx->frame_size; i++) {
++ int r = (av_lfg_get(&p->lfg) & 0xffff) - 0x8000;
++ p->excitation[i] = scaling * r;
++ }
++ ff_celp_lp_synthesis_filterf(p->filter_out + p->order, p->lpc_coef,
++ p->excitation, avctx->frame_size, p->order);
++
++ p->avframe.nb_samples = avctx->frame_size;
++ if ((ret = avctx->get_buffer(avctx, &p->avframe)) < 0) {
++ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
++ return ret;
++ }
++ buf_out = (int16_t *)p->avframe.data[0];
++ for (i = 0; i < avctx->frame_size; i++)
++ buf_out[i] = p->filter_out[i + p->order];
++ memcpy(p->filter_out, p->filter_out + avctx->frame_size,
++ p->order * sizeof(*p->filter_out));
++
++ *got_frame_ptr = 1;
++ *(AVFrame *)data = p->avframe;
++
++ return buf_size;
++}
++
++AVCodec ff_comfortnoise_decoder = {
++ .name = "comfortnoise",
++ .type = AVMEDIA_TYPE_AUDIO,
++ .id = AV_CODEC_ID_COMFORT_NOISE,
++ .priv_data_size = sizeof(CNGContext),
++ .init = cng_decode_init,
++ .decode = cng_decode_frame,
++ .close = cng_decode_close,
++ .long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
++ .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
++ AV_SAMPLE_FMT_NONE },
++ .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
++};
+diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c
+new file mode 100644
+index 0000000..1e3f8f0
+--- /dev/null
++++ b/libavcodec/cngenc.c
+@@ -0,0 +1,116 @@
++/*
++ * RFC 3389 comfort noise generator
++ * Copyright (c) 2012 Martin Storsjo
++ *
++ * This file is part of Libav.
++ *
++ * Libav is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * Libav is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with Libav; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#include <math.h>
++
++#include "libavutil/common.h"
++#include "avcodec.h"
++#include "internal.h"
++#include "lpc.h"
++
++typedef struct CNGContext {
++ LPCContext lpc;
++ int order;
++ int32_t *samples32;
++ double *ref_coef;
++} CNGContext;
++
++static av_cold int cng_encode_close(AVCodecContext *avctx)
++{
++ CNGContext *p = avctx->priv_data;
++ ff_lpc_end(&p->lpc);
++ av_free(p->samples32);
++ av_free(p->ref_coef);
++ return 0;
++}
++
++static av_cold int cng_encode_init(AVCodecContext *avctx)
++{
++ CNGContext *p = avctx->priv_data;
++ int ret;
++
++ if (avctx->channels != 1) {
++ av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
++ return AVERROR(EINVAL);
++ }
++
++ avctx->frame_size = 640;
++ p->order = 10;
++ if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0)
++ return ret;
++ p->samples32 = av_malloc(avctx->frame_size * sizeof(*p->samples32));
++ p->ref_coef = av_malloc(p->order * sizeof(*p->ref_coef));
++ if (!p->samples32 || !p->ref_coef) {
++ cng_encode_close(avctx);
++ return AVERROR(ENOMEM);
++ }
++
++ return 0;
++}
++
++static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
++ const AVFrame *frame, int *got_packet_ptr)
++{
++ CNGContext *p = avctx->priv_data;
++ int ret, i;
++ double energy = 0;
++ int qdbov;
++ int16_t *samples = (int16_t*) frame->data[0];
++
++ if ((ret = ff_alloc_packet(avpkt, 1 + p->order))) {
++ av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
++ return ret;
++ }
++
++ for (i = 0; i < frame->nb_samples; i++) {
++ p->samples32[i] = samples[i];
++ energy += samples[i] * samples[i];
++ }
++ energy /= frame->nb_samples;
++ if (energy > 0) {
++ double dbov = 10 * log10(energy / 1081109975);
++ qdbov = av_clip(-floor(dbov), 0, 127);
++ } else {
++ qdbov = 127;
++ }
++ ret = ff_lpc_calc_ref_coefs(&p->lpc, p->samples32, p->order, p->ref_coef);
++ avpkt->data[0] = qdbov;
++ for (i = 0; i < p->order; i++)
++ avpkt->data[1 + i] = p->ref_coef[i] * 127 + 127;
++
++ *got_packet_ptr = 1;
++ avpkt->size = 1 + p->order;
++
++ return 0;
++}
++
++AVCodec ff_comfortnoise_encoder = {
++ .name = "comfortnoise",
++ .type = AVMEDIA_TYPE_AUDIO,
++ .id = AV_CODEC_ID_COMFORT_NOISE,
++ .priv_data_size = sizeof(CNGContext),
++ .init = cng_encode_init,
++ .encode2 = cng_encode_frame,
++ .close = cng_encode_close,
++ .long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
++ .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
++ AV_SAMPLE_FMT_NONE },
++};
+diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
+index 818a35e..a8ff314 100644
+--- a/libavcodec/codec_desc.c
++++ b/libavcodec/codec_desc.c
+@@ -2112,6 +2112,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
+ .long_name = NULL_IF_CONFIG_SMALL("Opus (Opus Interactive Audio Codec)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
++ {
++ .id = AV_CODEC_ID_COMFORT_NOISE,
++ .type = AVMEDIA_TYPE_AUDIO,
++ .name = "comfortnoise",
++ .long_name = NULL_IF_CONFIG_SMALL("RFC 3389 Comfort Noise"),
++ .props = AV_CODEC_PROP_LOSSY,
++ },
+
+ /* subtitle codecs */
+ {
+diff --git a/libavcodec/version.h b/libavcodec/version.h
+index b702f4b..5ee7c7c 100644
+--- a/libavcodec/version.h
++++ b/libavcodec/version.h
+@@ -27,7 +27,7 @@
+ */
+
+ #define LIBAVCODEC_VERSION_MAJOR 54
+-#define LIBAVCODEC_VERSION_MINOR 31
++#define LIBAVCODEC_VERSION_MINOR 32
+ #define LIBAVCODEC_VERSION_MICRO 0
+
+ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0073-lavfi-add-ashowinfo-filter.patch b/debian/patches/post-9beta2/0073-lavfi-add-ashowinfo-filter.patch
new file mode 100644
index 0000000..be753e7
--- /dev/null
+++ b/debian/patches/post-9beta2/0073-lavfi-add-ashowinfo-filter.patch
@@ -0,0 +1,264 @@
+From 20dd41af8513de427b00ee598339c9bc5778bdc5 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Tue, 23 Oct 2012 21:37:26 +0200
+Subject: [PATCH 073/204] lavfi: add ashowinfo filter
+
+It can be useful for debugging.
+
+Based on a patch by Stefano Sabatini <stefano.sabatini-lala at poste.it>
+---
+ Changelog | 1 +
+ doc/filters.texi | 41 +++++++++++++
+ libavfilter/Makefile | 1 +
+ libavfilter/af_ashowinfo.c | 136 ++++++++++++++++++++++++++++++++++++++++++++
+ libavfilter/allfilters.c | 1 +
+ libavfilter/version.h | 2 +-
+ 6 files changed, 181 insertions(+), 1 deletion(-)
+ create mode 100644 libavfilter/af_ashowinfo.c
+
+diff --git a/Changelog b/Changelog
+index c3d55c1..e2c4273 100644
+--- a/Changelog
++++ b/Changelog
+@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
+ version <next>:
+ - metadata (INFO tag) support in WAV muxer
+ - support for building DLLs using MSVC
++- ashowinfo audio filter
+
+
+ version 9_beta1:
+diff --git a/doc/filters.texi b/doc/filters.texi
+index 8f90e84..85c8ae0 100644
+--- a/doc/filters.texi
++++ b/doc/filters.texi
+@@ -175,6 +175,47 @@ stream ends. The default value is 2 seconds.
+
+ Pass the audio source unchanged to the output.
+
++ at section ashowinfo
++
++Show a line containing various information for each input audio frame.
++The input audio is not modified.
++
++The shown line contains a sequence of key/value pairs of the form
++ at var{key}:@var{value}.
++
++A description of each shown parameter follows:
++
++ at table @option
++ at item n
++sequential number of the input frame, starting from 0
++
++ at item pts
++Presentation timestamp of the input frame, in time base units; the time base
++depends on the filter input pad, and is usually 1/@var{sample_rate}.
++
++ at item pts_time
++presentation timestamp of the input frame in seconds
++
++ at item fmt
++sample format
++
++ at item chlayout
++channel layout
++
++ at item rate
++sample rate for the audio frame
++
++ at item nb_samples
++number of samples (per channel) in the frame
++
++ at item checksum
++Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
++the data is treated as if all the planes were concatenated.
++
++ at item plane_checksums
++A list of Adler-32 checksums for each data plane.
++ at end table
++
+ @section asplit
+
+ Split input audio into several identical outputs.
+diff --git a/libavfilter/Makefile b/libavfilter/Makefile
+index 530aa57..9770e1f 100644
+--- a/libavfilter/Makefile
++++ b/libavfilter/Makefile
+@@ -28,6 +28,7 @@ OBJS-$(CONFIG_AFIFO_FILTER) += fifo.o
+ OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o
+ OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o
+ OBJS-$(CONFIG_ANULL_FILTER) += af_anull.o
++OBJS-$(CONFIG_ASHOWINFO_FILTER) += af_ashowinfo.o
+ OBJS-$(CONFIG_ASPLIT_FILTER) += split.o
+ OBJS-$(CONFIG_ASYNCTS_FILTER) += af_asyncts.o
+ OBJS-$(CONFIG_CHANNELMAP_FILTER) += af_channelmap.o
+diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c
+new file mode 100644
+index 0000000..00e0322
+--- /dev/null
++++ b/libavfilter/af_ashowinfo.c
+@@ -0,0 +1,136 @@
++/*
++ * Copyright (c) 2011 Stefano Sabatini
++ *
++ * This file is part of Libav.
++ *
++ * Libav is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * Libav is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with Libav; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++/**
++ * @file
++ * filter for showing textual audio frame information
++ */
++
++#include <inttypes.h>
++#include <stddef.h>
++
++#include "libavutil/adler32.h"
++#include "libavutil/audioconvert.h"
++#include "libavutil/common.h"
++#include "libavutil/mem.h"
++#include "libavutil/samplefmt.h"
++
++#include "audio.h"
++#include "avfilter.h"
++
++typedef struct AShowInfoContext {
++ /**
++ * Scratch space for individual plane checksums for planar audio
++ */
++ uint32_t *plane_checksums;
++
++ /**
++ * Frame counter
++ */
++ uint64_t frame;
++} AShowInfoContext;
++
++static int config_input(AVFilterLink *inlink)
++{
++ AShowInfoContext *s = inlink->dst->priv;
++ int channels = av_get_channel_layout_nb_channels(inlink->channel_layout);
++ s->plane_checksums = av_malloc(channels * sizeof(*s->plane_checksums));
++ if (!s->plane_checksums)
++ return AVERROR(ENOMEM);
++
++ return 0;
++}
++
++static void uninit(AVFilterContext *ctx)
++{
++ AShowInfoContext *s = ctx->priv;
++ av_freep(&s->plane_checksums);
++}
++
++static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
++{
++ AVFilterContext *ctx = inlink->dst;
++ AShowInfoContext *s = ctx->priv;
++ char chlayout_str[128];
++ uint32_t checksum = 0;
++ int channels = av_get_channel_layout_nb_channels(buf->audio->channel_layout);
++ int planar = av_sample_fmt_is_planar(buf->format);
++ int block_align = av_get_bytes_per_sample(buf->format) * (planar ? 1 : channels);
++ int data_size = buf->audio->nb_samples * block_align;
++ int planes = planar ? channels : 1;
++ int i;
++
++ for (i = 0; i < planes; i++) {
++ uint8_t *data = buf->extended_data[i];
++
++ s->plane_checksums[i] = av_adler32_update(0, data, data_size);
++ checksum = i ? av_adler32_update(checksum, data, data_size) :
++ s->plane_checksums[0];
++ }
++
++ av_get_channel_layout_string(chlayout_str, sizeof(chlayout_str), -1,
++ buf->audio->channel_layout);
++
++ av_log(ctx, AV_LOG_INFO,
++ "n:%"PRIu64" pts:%"PRId64" pts_time:%f "
++ "fmt:%s chlayout:%s rate:%d nb_samples:%d "
++ "checksum:%08X ",
++ s->frame, buf->pts, buf->pts * av_q2d(inlink->time_base),
++ av_get_sample_fmt_name(buf->format), chlayout_str,
++ buf->audio->sample_rate, buf->audio->nb_samples,
++ checksum);
++
++ av_log(ctx, AV_LOG_INFO, "plane_checksums: [ ");
++ for (i = 0; i < planes; i++)
++ av_log(ctx, AV_LOG_INFO, "%08X ", s->plane_checksums[i]);
++ av_log(ctx, AV_LOG_INFO, "]\n");
++
++ s->frame++;
++ return ff_filter_samples(inlink->dst->outputs[0], buf);
++}
++
++static const AVFilterPad inputs[] = {
++ {
++ .name = "default",
++ .type = AVMEDIA_TYPE_AUDIO,
++ .get_audio_buffer = ff_null_get_audio_buffer,
++ .config_props = config_input,
++ .filter_samples = filter_samples,
++ .min_perms = AV_PERM_READ,
++ },
++ { NULL },
++};
++
++static const AVFilterPad outputs[] = {
++ {
++ .name = "default",
++ .type = AVMEDIA_TYPE_AUDIO,
++ },
++ { NULL },
++};
++
++AVFilter avfilter_af_ashowinfo = {
++ .name = "ashowinfo",
++ .description = NULL_IF_CONFIG_SMALL("Show textual information for each audio frame."),
++ .priv_size = sizeof(AShowInfoContext),
++ .uninit = uninit,
++ .inputs = inputs,
++ .outputs = outputs,
++};
+diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
+index 94b3115..e759931 100644
+--- a/libavfilter/allfilters.c
++++ b/libavfilter/allfilters.c
+@@ -39,6 +39,7 @@ void avfilter_register_all(void)
+ REGISTER_FILTER (AFORMAT, aformat, af);
+ REGISTER_FILTER (AMIX, amix, af);
+ REGISTER_FILTER (ANULL, anull, af);
++ REGISTER_FILTER (ASHOWINFO, ashowinfo, af);
+ REGISTER_FILTER (ASPLIT, asplit, af);
+ REGISTER_FILTER (ASYNCTS, asyncts, af);
+ REGISTER_FILTER (CHANNELMAP, channelmap, af);
+diff --git a/libavfilter/version.h b/libavfilter/version.h
+index 0e72a47..eb5326b 100644
+--- a/libavfilter/version.h
++++ b/libavfilter/version.h
+@@ -29,7 +29,7 @@
+ #include "libavutil/avutil.h"
+
+ #define LIBAVFILTER_VERSION_MAJOR 3
+-#define LIBAVFILTER_VERSION_MINOR 1
++#define LIBAVFILTER_VERSION_MINOR 2
+ #define LIBAVFILTER_VERSION_MICRO 0
+
+ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0074-dv-use-AVStream.index-instead-of-abusing-AVStream.id.patch b/debian/patches/post-9beta2/0074-dv-use-AVStream.index-instead-of-abusing-AVStream.id.patch
new file mode 100644
index 0000000..b951fb4
--- /dev/null
+++ b/debian/patches/post-9beta2/0074-dv-use-AVStream.index-instead-of-abusing-AVStream.id.patch
@@ -0,0 +1,26 @@
+From 14f031d7ecfabba0ef02776d4516aa3dcb7c40d8 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 24 Oct 2012 09:06:32 +0200
+Subject: [PATCH 074/204] dv: use AVStream.index instead of abusing
+ AVStream.id
+
+---
+ libavformat/dv.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavformat/dv.c b/libavformat/dv.c
+index 70786b1..17c545c 100644
+--- a/libavformat/dv.c
++++ b/libavformat/dv.c
+@@ -372,7 +372,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
+ pkt->data = buf;
+ pkt->size = size;
+ pkt->flags |= AV_PKT_FLAG_KEY;
+- pkt->stream_index = c->vst->id;
++ pkt->stream_index = c->vst->index;
+ pkt->pts = c->frames;
+
+ c->frames++;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0075-dv-fix-indentation.patch b/debian/patches/post-9beta2/0075-dv-fix-indentation.patch
new file mode 100644
index 0000000..5356d4b
--- /dev/null
+++ b/debian/patches/post-9beta2/0075-dv-fix-indentation.patch
@@ -0,0 +1,117 @@
+From ede4cedf47f4f0ad26d61d28aa0ae2917c0c833e Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 24 Oct 2012 09:12:42 +0200
+Subject: [PATCH 075/204] dv: fix indentation
+
+---
+ libavformat/dv.c | 60 +++++++++++++++++++++++++++---------------------------
+ 1 file changed, 30 insertions(+), 30 deletions(-)
+
+diff --git a/libavformat/dv.c b/libavformat/dv.c
+index 17c545c..5ce73f7 100644
+--- a/libavformat/dv.c
++++ b/libavformat/dv.c
+@@ -230,24 +230,24 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
+
+ /* Dynamic handling of the audio streams in DV */
+ for (i = 0; i < ach; i++) {
+- if (!c->ast[i]) {
+- c->ast[i] = avformat_new_stream(c->fctx, NULL);
+- if (!c->ast[i])
+- break;
+- avpriv_set_pts_info(c->ast[i], 64, 1, 30000);
+- c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+- c->ast[i]->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
+-
+- av_init_packet(&c->audio_pkt[i]);
+- c->audio_pkt[i].size = 0;
+- c->audio_pkt[i].data = c->audio_buf[i];
+- c->audio_pkt[i].stream_index = c->ast[i]->index;
+- c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY;
+- }
+- c->ast[i]->codec->sample_rate = dv_audio_frequency[freq];
+- c->ast[i]->codec->channels = 2;
+- c->ast[i]->codec->bit_rate = 2 * dv_audio_frequency[freq] * 16;
+- c->ast[i]->start_time = 0;
++ if (!c->ast[i]) {
++ c->ast[i] = avformat_new_stream(c->fctx, NULL);
++ if (!c->ast[i])
++ break;
++ avpriv_set_pts_info(c->ast[i], 64, 1, 30000);
++ c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
++ c->ast[i]->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
++
++ av_init_packet(&c->audio_pkt[i]);
++ c->audio_pkt[i].size = 0;
++ c->audio_pkt[i].data = c->audio_buf[i];
++ c->audio_pkt[i].stream_index = c->ast[i]->index;
++ c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY;
++ }
++ c->ast[i]->codec->sample_rate = dv_audio_frequency[freq];
++ c->ast[i]->codec->channels = 2;
++ c->ast[i]->codec->bit_rate = 2 * dv_audio_frequency[freq] * 16;
++ c->ast[i]->start_time = 0;
+ }
+ c->ach = i;
+
+@@ -265,7 +265,7 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
+ avctx = c->vst->codec;
+
+ avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
+- c->sys->time_base.den);
++ c->sys->time_base.den);
+ avctx->time_base= c->sys->time_base;
+ if (!avctx->width){
+ avctx->width = c->sys->width;
+@@ -277,7 +277,7 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
+ 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)));
++ (!apt && (vsc_pack[2] & 0x07) == 0x07)));
+ c->vst->sample_aspect_ratio = c->sys->sar[is16_9];
+ avctx->bit_rate = av_rescale_q(c->sys->frame_size, (AVRational){8,1},
+ c->sys->time_base);
+@@ -319,12 +319,12 @@ int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
+ int i;
+
+ for (i = 0; i < c->ach; i++) {
+- if (c->ast[i] && c->audio_pkt[i].size) {
+- *pkt = c->audio_pkt[i];
+- c->audio_pkt[i].size = 0;
+- size = pkt->size;
+- break;
+- }
++ if (c->ast[i] && c->audio_pkt[i].size) {
++ *pkt = c->audio_pkt[i];
++ c->audio_pkt[i].size = 0;
++ size = pkt->size;
++ break;
++ }
+ }
+
+ return size;
+@@ -339,16 +339,16 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
+ if (buf_size < DV_PROFILE_BYTES ||
+ !(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
+ buf_size < c->sys->frame_size) {
+- return -1; /* Broken frame, or not enough data */
++ return -1; /* Broken frame, or not enough data */
+ }
+
+ /* Queueing audio packet */
+ /* FIXME: in case of no audio/bad audio we have to do something */
+ size = dv_extract_audio_info(c, buf);
+ for (i = 0; i < c->ach; i++) {
+- c->audio_pkt[i].size = size;
+- c->audio_pkt[i].pts = c->abytes * 30000*8 / c->ast[i]->codec->bit_rate;
+- ppcm[i] = c->audio_buf[i];
++ c->audio_pkt[i].size = size;
++ c->audio_pkt[i].pts = c->abytes * 30000 * 8 / c->ast[i]->codec->bit_rate;
++ ppcm[i] = c->audio_buf[i];
+ }
+ if (c->ach)
+ dv_extract_audio(buf, ppcm, c->sys);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0076-Remove-usage-of-INIT_AVX-in-h264_intrapred_10bit.asm.patch b/debian/patches/post-9beta2/0076-Remove-usage-of-INIT_AVX-in-h264_intrapred_10bit.asm.patch
new file mode 100644
index 0000000..91a9f86
--- /dev/null
+++ b/debian/patches/post-9beta2/0076-Remove-usage-of-INIT_AVX-in-h264_intrapred_10bit.asm.patch
@@ -0,0 +1,760 @@
+From c285edd06ea64a24c610c10c06975975cec0d50f Mon Sep 17 00:00:00 2001
+From: "Ronald S. Bultje" <rsbultje at gmail.com>
+Date: Sun, 28 Oct 2012 18:39:22 -0700
+Subject: [PATCH 076/204] Remove usage of INIT_AVX in
+ h264_intrapred_10bit.asm.
+
+Replace INIT_AVX by INIT_XMM avx. Port the whole file to use cpuflag
+based function declarations. Remove (now unused) cputype argument in
+function declaration macros. Change function prototypes to have mmx2
+instead of mmxext as suffix, since that's required by cpuflags.
+---
+ libavcodec/x86/h264_intrapred_10bit.asm | 306 ++++++++++++++++---------------
+ libavcodec/x86/h264_intrapred_init.c | 40 ++--
+ 2 files changed, 177 insertions(+), 169 deletions(-)
+
+diff --git a/libavcodec/x86/h264_intrapred_10bit.asm b/libavcodec/x86/h264_intrapred_10bit.asm
+index 529134e..c3f6dc4 100644
+--- a/libavcodec/x86/h264_intrapred_10bit.asm
++++ b/libavcodec/x86/h264_intrapred_10bit.asm
+@@ -53,8 +53,8 @@ SECTION .text
+ ;-----------------------------------------------------------------------------
+ ; void pred4x4_down_right(pixel *src, const pixel *topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED4x4_DR 1
+-cglobal pred4x4_down_right_10_%1, 3,3
++%macro PRED4x4_DR 0
++cglobal pred4x4_down_right_10, 3, 3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movhps m1, [r1-8]
+@@ -79,21 +79,22 @@ cglobal pred4x4_down_right_10_%1, 3,3
+ RET
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED4x4_DR sse2
++PRED4x4_DR
++INIT_XMM ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED4x4_DR ssse3
++PRED4x4_DR
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED4x4_DR avx
++INIT_XMM avx
++PRED4x4_DR
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ; void pred4x4_vertical_right(pixel *src, const pixel *topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED4x4_VR 1
+-cglobal pred4x4_vertical_right_10_%1, 3,3,6
++%macro PRED4x4_VR 0
++cglobal pred4x4_vertical_right_10, 3, 3, 6
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movq m5, [r0] ; ........t3t2t1t0
+@@ -119,21 +120,22 @@ cglobal pred4x4_vertical_right_10_%1, 3,3,6
+ RET
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED4x4_VR sse2
++PRED4x4_VR
++INIT_XMM ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED4x4_VR ssse3
++PRED4x4_VR
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED4x4_VR avx
++INIT_XMM avx
++PRED4x4_VR
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ; void pred4x4_horizontal_down(pixel *src, const pixel *topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED4x4_HD 1
+-cglobal pred4x4_horizontal_down_10_%1, 3,3
++%macro PRED4x4_HD 0
++cglobal pred4x4_horizontal_down_10, 3, 3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movq m0, [r0-8] ; lt ..
+@@ -162,14 +164,15 @@ cglobal pred4x4_horizontal_down_10_%1, 3,3
+ RET
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED4x4_HD sse2
++PRED4x4_HD
++INIT_XMM ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED4x4_HD ssse3
++PRED4x4_HD
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED4x4_HD avx
++INIT_XMM avx
++PRED4x4_HD
+ %endif
+
+ ;-----------------------------------------------------------------------------
+@@ -192,8 +195,8 @@ PRED4x4_HD avx
+ HADDD %1, %2
+ %endmacro
+
+-INIT_MMX
+-cglobal pred4x4_dc_10_mmxext, 3,3
++INIT_MMX mmx2
++cglobal pred4x4_dc_10, 3, 3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movq m2, [r0+r2*1-8]
+@@ -216,8 +219,8 @@ cglobal pred4x4_dc_10_mmxext, 3,3
+ ;-----------------------------------------------------------------------------
+ ; void pred4x4_down_left(pixel *src, const pixel *topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED4x4_DL 1
+-cglobal pred4x4_down_left_10_%1, 3,3
++%macro PRED4x4_DL 0
++cglobal pred4x4_down_left_10, 3, 3
+ sub r0, r2
+ movq m0, [r0]
+ movhps m0, [r1]
+@@ -236,18 +239,18 @@ cglobal pred4x4_down_left_10_%1, 3,3
+ RET
+ %endmacro
+
+-INIT_XMM
+-PRED4x4_DL sse2
++INIT_XMM sse2
++PRED4x4_DL
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED4x4_DL avx
++INIT_XMM avx
++PRED4x4_DL
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ; void pred4x4_vertical_left(pixel *src, const pixel *topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED4x4_VL 1
+-cglobal pred4x4_vertical_left_10_%1, 3,3
++%macro PRED4x4_VL 0
++cglobal pred4x4_vertical_left_10, 3, 3
+ sub r0, r2
+ movu m1, [r0]
+ movhps m1, [r1]
+@@ -265,18 +268,18 @@ cglobal pred4x4_vertical_left_10_%1, 3,3
+ RET
+ %endmacro
+
+-INIT_XMM
+-PRED4x4_VL sse2
++INIT_XMM sse2
++PRED4x4_VL
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED4x4_VL avx
++INIT_XMM avx
++PRED4x4_VL
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ; void pred4x4_horizontal_up(pixel *src, const pixel *topright, int stride)
+ ;-----------------------------------------------------------------------------
+-INIT_MMX
+-cglobal pred4x4_horizontal_up_10_mmxext, 3,3
++INIT_MMX mmx2
++cglobal pred4x4_horizontal_up_10, 3, 3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movq m0, [r0+r2*1-8]
+@@ -309,8 +312,8 @@ cglobal pred4x4_horizontal_up_10_mmxext, 3,3
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8_vertical(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-INIT_XMM
+-cglobal pred8x8_vertical_10_sse2, 2,2
++INIT_XMM sse2
++cglobal pred8x8_vertical_10, 2, 2
+ sub r0, r1
+ mova m0, [r0]
+ %rep 3
+@@ -325,8 +328,8 @@ cglobal pred8x8_vertical_10_sse2, 2,2
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8_horizontal(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-INIT_XMM
+-cglobal pred8x8_horizontal_10_sse2, 2,3
++INIT_XMM sse2
++cglobal pred8x8_horizontal_10, 2, 3
+ mov r2d, 4
+ .loop:
+ movq m0, [r0+r1*0-8]
+@@ -355,8 +358,8 @@ cglobal pred8x8_horizontal_10_sse2, 2,3
+ %endif
+ %endmacro
+
+-%macro PRED8x8_DC 2
+-cglobal pred8x8_dc_10_%1, 2,6
++%macro PRED8x8_DC 1
++cglobal pred8x8_dc_10, 2, 6
+ sub r0, r1
+ pxor m4, m4
+ movq m0, [r0+0]
+@@ -372,7 +375,7 @@ cglobal pred8x8_dc_10_%1, 2,6
+ paddw m1, m3
+ punpcklwd m0, m1
+ %endif
+- %2 m2, m0, 00001110b
++ %1 m2, m0, 00001110b
+ paddw m0, m2
+
+ lea r5, [r1*3]
+@@ -397,8 +400,8 @@ cglobal pred8x8_dc_10_%1, 2,6
+
+ punpcklwd m2, m3
+ punpckldq m0, m2 ; s0, s1, s2, s3
+- %2 m3, m0, 11110110b ; s2, s1, s3, s3
+- %2 m0, m0, 01110100b ; s0, s1, s3, s1
++ %1 m3, m0, 11110110b ; s2, s1, s3, s3
++ %1 m0, m0, 01110100b ; s0, s1, s3, s1
+ paddw m0, m3
+ psrlw m0, 2
+ pavgw m0, m4 ; s0+s2, s1, s3, s1+s3
+@@ -424,16 +427,16 @@ cglobal pred8x8_dc_10_%1, 2,6
+ RET
+ %endmacro
+
+-INIT_MMX
+-PRED8x8_DC mmxext, pshufw
+-INIT_XMM
+-PRED8x8_DC sse2 , pshuflw
++INIT_MMX mmx2
++PRED8x8_DC pshufw
++INIT_XMM sse2
++PRED8x8_DC pshuflw
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8_top_dc(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-INIT_XMM
+-cglobal pred8x8_top_dc_10_sse2, 2,4
++INIT_XMM sse2
++cglobal pred8x8_top_dc_10, 2, 4
+ sub r0, r1
+ mova m0, [r0]
+ pshuflw m1, m0, 0x4e
+@@ -459,8 +462,8 @@ cglobal pred8x8_top_dc_10_sse2, 2,4
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8_plane(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-INIT_XMM
+-cglobal pred8x8_plane_10_sse2, 2,7,7
++INIT_XMM sse2
++cglobal pred8x8_plane_10, 2, 7, 7
+ sub r0, r1
+ lea r2, [r1*3]
+ lea r3, [r0+r1*4]
+@@ -522,8 +525,8 @@ cglobal pred8x8_plane_10_sse2, 2,7,7
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_128_dc(pixel *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_128_DC 1
+-cglobal pred8x8l_128_dc_10_%1, 4,4
++%macro PRED8x8L_128_DC 0
++cglobal pred8x8l_128_dc_10, 4, 4
+ mova m0, [pw_512] ; (1<<(BIT_DEPTH-1))
+ lea r1, [r3*3]
+ lea r2, [r0+r3*4]
+@@ -538,16 +541,16 @@ cglobal pred8x8l_128_dc_10_%1, 4,4
+ RET
+ %endmacro
+
+-INIT_MMX
+-PRED8x8L_128_DC mmxext
+-INIT_XMM
+-PRED8x8L_128_DC sse2
++INIT_MMX mmx2
++PRED8x8L_128_DC
++INIT_XMM sse2
++PRED8x8L_128_DC
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_top_dc(pixel *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_TOP_DC 1
+-cglobal pred8x8l_top_dc_10_%1, 4,4,6
++%macro PRED8x8L_TOP_DC 0
++cglobal pred8x8l_top_dc_10, 4, 4, 6
+ sub r0, r3
+ mova m0, [r0]
+ shr r1d, 14
+@@ -575,19 +578,19 @@ cglobal pred8x8l_top_dc_10_%1, 4,4,6
+ RET
+ %endmacro
+
+-INIT_XMM
+-PRED8x8L_TOP_DC sse2
++INIT_XMM sse2
++PRED8x8L_TOP_DC
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED8x8L_TOP_DC avx
++INIT_XMM avx
++PRED8x8L_TOP_DC
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ;void pred8x8l_dc(pixel *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+ ;TODO: see if scalar is faster
+-%macro PRED8x8L_DC 1
+-cglobal pred8x8l_dc_10_%1, 4,6,6
++%macro PRED8x8L_DC 0
++cglobal pred8x8l_dc_10, 4, 6, 6
+ sub r0, r3
+ lea r4, [r0+r3*4]
+ lea r5, [r3*3]
+@@ -634,18 +637,18 @@ cglobal pred8x8l_dc_10_%1, 4,6,6
+ RET
+ %endmacro
+
+-INIT_XMM
+-PRED8x8L_DC sse2
++INIT_XMM sse2
++PRED8x8L_DC
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED8x8L_DC avx
++INIT_XMM avx
++PRED8x8L_DC
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_vertical(pixel *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_VERTICAL 1
+-cglobal pred8x8l_vertical_10_%1, 4,4,6
++%macro PRED8x8L_VERTICAL 0
++cglobal pred8x8l_vertical_10, 4, 4, 6
+ sub r0, r3
+ mova m0, [r0]
+ shr r1d, 14
+@@ -669,18 +672,18 @@ cglobal pred8x8l_vertical_10_%1, 4,4,6
+ RET
+ %endmacro
+
+-INIT_XMM
+-PRED8x8L_VERTICAL sse2
++INIT_XMM sse2
++PRED8x8L_VERTICAL
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED8x8L_VERTICAL avx
++INIT_XMM avx
++PRED8x8L_VERTICAL
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_horizontal(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_HORIZONTAL 1
+-cglobal pred8x8l_horizontal_10_%1, 4,4,5
++%macro PRED8x8L_HORIZONTAL 0
++cglobal pred8x8l_horizontal_10, 4, 4, 5
+ mova m0, [r0-16]
+ shr r1d, 14
+ dec r1
+@@ -723,21 +726,22 @@ cglobal pred8x8l_horizontal_10_%1, 4,4,5
+ RET
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_HORIZONTAL sse2
++PRED8x8L_HORIZONTAL
++INIT_XMM ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_HORIZONTAL ssse3
++PRED8x8L_HORIZONTAL
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED8x8L_HORIZONTAL avx
++INIT_XMM avx
++PRED8x8L_HORIZONTAL
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ;void pred8x8l_down_left(pixel *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_DOWN_LEFT 1
+-cglobal pred8x8l_down_left_10_%1, 4,4,7
++%macro PRED8x8L_DOWN_LEFT 0
++cglobal pred8x8l_down_left_10, 4, 4, 7
+ sub r0, r3
+ mova m3, [r0]
+ shr r1d, 14
+@@ -792,23 +796,24 @@ cglobal pred8x8l_down_left_10_%1, 4,4,7
+ jmp .do_topright
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_DOWN_LEFT sse2
++PRED8x8L_DOWN_LEFT
++INIT_XMM ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_DOWN_LEFT ssse3
++PRED8x8L_DOWN_LEFT
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED8x8L_DOWN_LEFT avx
++INIT_XMM avx
++PRED8x8L_DOWN_LEFT
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ;void pred8x8l_down_right(pixel *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_DOWN_RIGHT 1
++%macro PRED8x8L_DOWN_RIGHT 0
+ ; standard forbids this when has_topleft is false
+ ; no need to check
+-cglobal pred8x8l_down_right_10_%1, 4,5,8
++cglobal pred8x8l_down_right_10, 4, 5, 8
+ sub r0, r3
+ lea r4, [r0+r3*4]
+ lea r1, [r3*3]
+@@ -867,22 +872,23 @@ cglobal pred8x8l_down_right_10_%1, 4,5,8
+ RET
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_DOWN_RIGHT sse2
++PRED8x8L_DOWN_RIGHT
++INIT_XMM ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_DOWN_RIGHT ssse3
++PRED8x8L_DOWN_RIGHT
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED8x8L_DOWN_RIGHT avx
++INIT_XMM avx
++PRED8x8L_DOWN_RIGHT
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_vertical_right(pixel *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_VERTICAL_RIGHT 1
++%macro PRED8x8L_VERTICAL_RIGHT 0
+ ; likewise with 8x8l_down_right
+-cglobal pred8x8l_vertical_right_10_%1, 4,5,7
++cglobal pred8x8l_vertical_right_10, 4, 5, 7
+ sub r0, r3
+ lea r4, [r0+r3*4]
+ lea r1, [r3*3]
+@@ -938,21 +944,22 @@ cglobal pred8x8l_vertical_right_10_%1, 4,5,7
+ RET
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_VERTICAL_RIGHT sse2
++PRED8x8L_VERTICAL_RIGHT
++INIT_XMM ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_VERTICAL_RIGHT ssse3
++PRED8x8L_VERTICAL_RIGHT
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED8x8L_VERTICAL_RIGHT avx
++INIT_XMM avx
++PRED8x8L_VERTICAL_RIGHT
+ %endif
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_horizontal_up(pixel *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_HORIZONTAL_UP 1
+-cglobal pred8x8l_horizontal_up_10_%1, 4,4,6
++%macro PRED8x8L_HORIZONTAL_UP 0
++cglobal pred8x8l_horizontal_up_10, 4, 4, 6
+ mova m0, [r0+r3*0-16]
+ punpckhwd m0, [r0+r3*1-16]
+ shr r1d, 14
+@@ -1000,14 +1007,15 @@ cglobal pred8x8l_horizontal_up_10_%1, 4,4,6
+ RET
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_HORIZONTAL_UP sse2
++PRED8x8L_HORIZONTAL_UP
++INIT_XMM ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_HORIZONTAL_UP ssse3
++PRED8x8L_HORIZONTAL_UP
+ %if HAVE_AVX_EXTERNAL
+-INIT_AVX
+-PRED8x8L_HORIZONTAL_UP avx
++INIT_XMM avx
++PRED8x8L_HORIZONTAL_UP
+ %endif
+
+
+@@ -1023,8 +1031,8 @@ PRED8x8L_HORIZONTAL_UP avx
+ %endif
+ %endmacro
+
+-%macro PRED16x16_VERTICAL 1
+-cglobal pred16x16_vertical_10_%1, 2,3
++%macro PRED16x16_VERTICAL 0
++cglobal pred16x16_vertical_10, 2, 3
+ sub r0, r1
+ mov r2d, 8
+ mova m0, [r0+ 0]
+@@ -1042,16 +1050,16 @@ cglobal pred16x16_vertical_10_%1, 2,3
+ REP_RET
+ %endmacro
+
+-INIT_MMX
+-PRED16x16_VERTICAL mmxext
+-INIT_XMM
+-PRED16x16_VERTICAL sse2
++INIT_MMX mmx2
++PRED16x16_VERTICAL
++INIT_XMM sse2
++PRED16x16_VERTICAL
+
+ ;-----------------------------------------------------------------------------
+ ; void pred16x16_horizontal(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED16x16_HORIZONTAL 1
+-cglobal pred16x16_horizontal_10_%1, 2,3
++%macro PRED16x16_HORIZONTAL 0
++cglobal pred16x16_horizontal_10, 2, 3
+ mov r2d, 8
+ .vloop:
+ movd m0, [r0+r1*0-4]
+@@ -1066,16 +1074,16 @@ cglobal pred16x16_horizontal_10_%1, 2,3
+ REP_RET
+ %endmacro
+
+-INIT_MMX
+-PRED16x16_HORIZONTAL mmxext
+-INIT_XMM
+-PRED16x16_HORIZONTAL sse2
++INIT_MMX mmx2
++PRED16x16_HORIZONTAL
++INIT_XMM sse2
++PRED16x16_HORIZONTAL
+
+ ;-----------------------------------------------------------------------------
+ ; void pred16x16_dc(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED16x16_DC 1
+-cglobal pred16x16_dc_10_%1, 2,6
++%macro PRED16x16_DC 0
++cglobal pred16x16_dc_10, 2, 6
+ mov r5, r0
+ sub r0, r1
+ mova m0, [r0+0]
+@@ -1112,16 +1120,16 @@ cglobal pred16x16_dc_10_%1, 2,6
+ REP_RET
+ %endmacro
+
+-INIT_MMX
+-PRED16x16_DC mmxext
+-INIT_XMM
+-PRED16x16_DC sse2
++INIT_MMX mmx2
++PRED16x16_DC
++INIT_XMM sse2
++PRED16x16_DC
+
+ ;-----------------------------------------------------------------------------
+ ; void pred16x16_top_dc(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED16x16_TOP_DC 1
+-cglobal pred16x16_top_dc_10_%1, 2,3
++%macro PRED16x16_TOP_DC 0
++cglobal pred16x16_top_dc_10, 2, 3
+ sub r0, r1
+ mova m0, [r0+0]
+ paddw m0, [r0+mmsize]
+@@ -1144,16 +1152,16 @@ cglobal pred16x16_top_dc_10_%1, 2,3
+ REP_RET
+ %endmacro
+
+-INIT_MMX
+-PRED16x16_TOP_DC mmxext
+-INIT_XMM
+-PRED16x16_TOP_DC sse2
++INIT_MMX mmx2
++PRED16x16_TOP_DC
++INIT_XMM sse2
++PRED16x16_TOP_DC
+
+ ;-----------------------------------------------------------------------------
+ ; void pred16x16_left_dc(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED16x16_LEFT_DC 1
+-cglobal pred16x16_left_dc_10_%1, 2,6
++%macro PRED16x16_LEFT_DC 0
++cglobal pred16x16_left_dc_10, 2, 6
+ mov r5, r0
+
+ sub r0, 2
+@@ -1181,16 +1189,16 @@ cglobal pred16x16_left_dc_10_%1, 2,6
+ REP_RET
+ %endmacro
+
+-INIT_MMX
+-PRED16x16_LEFT_DC mmxext
+-INIT_XMM
+-PRED16x16_LEFT_DC sse2
++INIT_MMX mmx2
++PRED16x16_LEFT_DC
++INIT_XMM sse2
++PRED16x16_LEFT_DC
+
+ ;-----------------------------------------------------------------------------
+ ; void pred16x16_128_dc(pixel *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED16x16_128_DC 1
+-cglobal pred16x16_128_dc_10_%1, 2,3
++%macro PRED16x16_128_DC 0
++cglobal pred16x16_128_dc_10, 2,3
+ mova m0, [pw_512]
+ mov r2d, 8
+ .loop:
+@@ -1202,7 +1210,7 @@ cglobal pred16x16_128_dc_10_%1, 2,3
+ REP_RET
+ %endmacro
+
+-INIT_MMX
+-PRED16x16_128_DC mmxext
+-INIT_XMM
+-PRED16x16_128_DC sse2
++INIT_MMX mmx2
++PRED16x16_128_DC
++INIT_XMM sse2
++PRED16x16_128_DC
+diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
+index cd82f47..7a6daac 100644
+--- a/libavcodec/x86/h264_intrapred_init.c
++++ b/libavcodec/x86/h264_intrapred_init.c
+@@ -25,7 +25,7 @@
+ #define PRED4x4(TYPE, DEPTH, OPT) \
+ void ff_pred4x4_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, const uint8_t *topright, int stride);
+
+-PRED4x4(dc, 10, mmxext)
++PRED4x4(dc, 10, mmx2)
+ PRED4x4(down_left, 10, sse2)
+ PRED4x4(down_left, 10, avx)
+ PRED4x4(down_right, 10, sse2)
+@@ -36,7 +36,7 @@ PRED4x4(vertical_left, 10, avx)
+ PRED4x4(vertical_right, 10, sse2)
+ PRED4x4(vertical_right, 10, ssse3)
+ PRED4x4(vertical_right, 10, avx)
+-PRED4x4(horizontal_up, 10, mmxext)
++PRED4x4(horizontal_up, 10, mmx2)
+ PRED4x4(horizontal_down, 10, sse2)
+ PRED4x4(horizontal_down, 10, ssse3)
+ PRED4x4(horizontal_down, 10, avx)
+@@ -44,7 +44,7 @@ PRED4x4(horizontal_down, 10, avx)
+ #define PRED8x8(TYPE, DEPTH, OPT) \
+ void ff_pred8x8_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
+
+-PRED8x8(dc, 10, mmxext)
++PRED8x8(dc, 10, mmx2)
+ PRED8x8(dc, 10, sse2)
+ PRED8x8(top_dc, 10, sse2)
+ PRED8x8(plane, 10, sse2)
+@@ -56,7 +56,7 @@ void ff_pred8x8l_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int has_tople
+
+ PRED8x8L(dc, 10, sse2)
+ PRED8x8L(dc, 10, avx)
+-PRED8x8L(128_dc, 10, mmxext)
++PRED8x8L(128_dc, 10, mmx2)
+ PRED8x8L(128_dc, 10, sse2)
+ PRED8x8L(top_dc, 10, sse2)
+ PRED8x8L(top_dc, 10, avx)
+@@ -81,17 +81,17 @@ PRED8x8L(horizontal_up, 10, avx)
+ #define PRED16x16(TYPE, DEPTH, OPT)\
+ void ff_pred16x16_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
+
+-PRED16x16(dc, 10, mmxext)
++PRED16x16(dc, 10, mmx2)
+ PRED16x16(dc, 10, sse2)
+-PRED16x16(top_dc, 10, mmxext)
++PRED16x16(top_dc, 10, mmx2)
+ PRED16x16(top_dc, 10, sse2)
+-PRED16x16(128_dc, 10, mmxext)
++PRED16x16(128_dc, 10, mmx2)
+ PRED16x16(128_dc, 10, sse2)
+-PRED16x16(left_dc, 10, mmxext)
++PRED16x16(left_dc, 10, mmx2)
+ PRED16x16(left_dc, 10, sse2)
+-PRED16x16(vertical, 10, mmxext)
++PRED16x16(vertical, 10, mmx2)
+ PRED16x16(vertical, 10, sse2)
+-PRED16x16(horizontal, 10, mmxext)
++PRED16x16(horizontal, 10, mmx2)
+ PRED16x16(horizontal, 10, sse2)
+
+ void ff_pred16x16_vertical_mmx (uint8_t *src, int stride);
+@@ -309,20 +309,20 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth
+ }
+ } else if (bit_depth == 10) {
+ if (EXTERNAL_MMXEXT(mm_flags)) {
+- h->pred4x4[DC_PRED ] = ff_pred4x4_dc_10_mmxext;
+- h->pred4x4[HOR_UP_PRED ] = ff_pred4x4_horizontal_up_10_mmxext;
++ h->pred4x4[DC_PRED ] = ff_pred4x4_dc_10_mmx2;
++ h->pred4x4[HOR_UP_PRED ] = ff_pred4x4_horizontal_up_10_mmx2;
+
+ if (chroma_format_idc == 1)
+- h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_10_mmxext;
++ h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_10_mmx2;
+
+- h->pred8x8l[DC_128_PRED ] = ff_pred8x8l_128_dc_10_mmxext;
++ h->pred8x8l[DC_128_PRED ] = ff_pred8x8l_128_dc_10_mmx2;
+
+- h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_10_mmxext;
+- h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_10_mmxext;
+- h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_10_mmxext;
+- h->pred16x16[LEFT_DC_PRED8x8 ] = ff_pred16x16_left_dc_10_mmxext;
+- h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_10_mmxext;
+- h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_10_mmxext;
++ h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_10_mmx2;
++ h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_10_mmx2;
++ h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_10_mmx2;
++ h->pred16x16[LEFT_DC_PRED8x8 ] = ff_pred16x16_left_dc_10_mmx2;
++ h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_10_mmx2;
++ h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_10_mmx2;
+ }
+ if (EXTERNAL_SSE2(mm_flags)) {
+ h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_sse2;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0077-Remove-INIT_AVX-from-x86inc.asm.patch b/debian/patches/post-9beta2/0077-Remove-INIT_AVX-from-x86inc.asm.patch
new file mode 100644
index 0000000..8bdc33b
--- /dev/null
+++ b/debian/patches/post-9beta2/0077-Remove-INIT_AVX-from-x86inc.asm.patch
@@ -0,0 +1,31 @@
+From 08b028c18dc31b6de741861b9555669dcca4d12a Mon Sep 17 00:00:00 2001
+From: "Ronald S. Bultje" <rsbultje at gmail.com>
+Date: Sun, 28 Oct 2012 18:39:23 -0700
+Subject: [PATCH 077/204] Remove INIT_AVX from x86inc.asm.
+
+---
+ libavutil/x86/x86inc.asm | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
+index d734c6e..1fe9f55 100644
+--- a/libavutil/x86/x86inc.asm
++++ b/libavutil/x86/x86inc.asm
+@@ -678,14 +678,6 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits
+ INIT_CPUFLAGS %1
+ %endmacro
+
+-; FIXME: INIT_AVX can be replaced by INIT_XMM avx
+-%macro INIT_AVX 0
+- INIT_XMM
+- %assign avx_enabled 1
+- %define PALIGNR PALIGNR_SSSE3
+- %define RESET_MM_PERMUTATION INIT_AVX
+-%endmacro
+-
+ %macro INIT_YMM 0-1+
+ %assign avx_enabled 1
+ %define RESET_MM_PERMUTATION INIT_YMM %1
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0078-x86-use-PRED4x4-8x8-8x8L-16x16-macros-to-declare-int.patch b/debian/patches/post-9beta2/0078-x86-use-PRED4x4-8x8-8x8L-16x16-macros-to-declare-int.patch
new file mode 100644
index 0000000..5e072a3
--- /dev/null
+++ b/debian/patches/post-9beta2/0078-x86-use-PRED4x4-8x8-8x8L-16x16-macros-to-declare-int.patch
@@ -0,0 +1,749 @@
+From bad8e33dc92aa2abd39410be86159a1d4336ff90 Mon Sep 17 00:00:00 2001
+From: "Ronald S. Bultje" <rsbultje at gmail.com>
+Date: Sun, 28 Oct 2012 20:44:53 -0700
+Subject: [PATCH 078/204] x86: use PRED4x4/8x8/8x8L/16x16 macros to declare
+ intrapred prototypes.
+
+---
+ libavcodec/x86/h264_intrapred.asm | 80 ++++-----
+ libavcodec/x86/h264_intrapred_init.c | 296 +++++++++++++++++-----------------
+ 2 files changed, 190 insertions(+), 186 deletions(-)
+
+diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
+index dc418f7..7c6aa12 100644
+--- a/libavcodec/x86/h264_intrapred.asm
++++ b/libavcodec/x86/h264_intrapred.asm
+@@ -53,7 +53,7 @@ cextern pw_32
+ ; void pred16x16_vertical(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-cglobal pred16x16_vertical_mmx, 2,3
++cglobal pred16x16_vertical_8_mmx, 2,3
+ sub r0, r1
+ mov r2, 8
+ movq mm0, [r0+0]
+@@ -68,7 +68,7 @@ cglobal pred16x16_vertical_mmx, 2,3
+ jg .loop
+ REP_RET
+
+-cglobal pred16x16_vertical_sse, 2,3
++cglobal pred16x16_vertical_8_sse, 2,3
+ sub r0, r1
+ mov r2, 4
+ movaps xmm0, [r0]
+@@ -88,7 +88,7 @@ cglobal pred16x16_vertical_sse, 2,3
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED16x16_H 0
+-cglobal pred16x16_horizontal, 2,3
++cglobal pred16x16_horizontal_8, 2,3
+ mov r2, 8
+ %if cpuflag(ssse3)
+ mova m2, [pb_3]
+@@ -130,7 +130,7 @@ INIT_XMM
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED16x16_DC 0
+-cglobal pred16x16_dc, 2,7
++cglobal pred16x16_dc_8, 2,7
+ mov r4, r0
+ sub r0, r1
+ pxor mm0, mm0
+@@ -193,7 +193,7 @@ INIT_XMM
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED16x16_TM_MMX 0
+-cglobal pred16x16_tm_vp8, 2,5
++cglobal pred16x16_tm_vp8_8, 2,5
+ sub r0, r1
+ pxor mm7, mm7
+ movq mm0, [r0+0]
+@@ -234,7 +234,7 @@ INIT_MMX mmx2
+ PRED16x16_TM_MMX
+ INIT_MMX
+
+-cglobal pred16x16_tm_vp8_sse2, 2,6,6
++cglobal pred16x16_tm_vp8_8_sse2, 2,6,6
+ sub r0, r1
+ pxor xmm2, xmm2
+ movdqa xmm0, [r0]
+@@ -274,7 +274,7 @@ cglobal pred16x16_tm_vp8_sse2, 2,6,6
+ ;-----------------------------------------------------------------------------
+
+ %macro H264_PRED16x16_PLANE 1
+-cglobal pred16x16_plane_%1, 2,9,7
++cglobal pred16x16_plane_%1_8, 2,9,7
+ mov r2, r1 ; +stride
+ neg r1 ; -stride
+
+@@ -556,7 +556,7 @@ INIT_XMM
+ ;-----------------------------------------------------------------------------
+
+ %macro H264_PRED8x8_PLANE 0
+-cglobal pred8x8_plane, 2,9,7
++cglobal pred8x8_plane_8, 2,9,7
+ mov r2, r1 ; +stride
+ neg r1 ; -stride
+
+@@ -730,7 +730,7 @@ INIT_XMM
+ ; void pred8x8_vertical(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-cglobal pred8x8_vertical_mmx, 2,2
++cglobal pred8x8_vertical_8_mmx, 2,2
+ sub r0, r1
+ movq mm0, [r0]
+ %rep 3
+@@ -747,7 +747,7 @@ cglobal pred8x8_vertical_mmx, 2,2
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED8x8_H 0
+-cglobal pred8x8_horizontal, 2,3
++cglobal pred8x8_horizontal_8, 2,3
+ mov r2, 4
+ %if cpuflag(ssse3)
+ mova m2, [pb_3]
+@@ -774,7 +774,7 @@ INIT_MMX
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8_top_dc_mmxext(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-cglobal pred8x8_top_dc_mmxext, 2,5
++cglobal pred8x8_top_dc_8_mmxext, 2,5
+ sub r0, r1
+ movq mm0, [r0]
+ pxor mm1, mm1
+@@ -809,7 +809,7 @@ cglobal pred8x8_top_dc_mmxext, 2,5
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX
+-cglobal pred8x8_dc_mmxext, 2,5
++cglobal pred8x8_dc_8_mmxext, 2,5
+ sub r0, r1
+ pxor m7, m7
+ movd m0, [r0+0]
+@@ -869,7 +869,7 @@ cglobal pred8x8_dc_mmxext, 2,5
+ ; void pred8x8_dc_rv40(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-cglobal pred8x8_dc_rv40_mmxext, 2,7
++cglobal pred8x8_dc_rv40_8_mmxext, 2,7
+ mov r4, r0
+ sub r0, r1
+ pxor mm0, mm0
+@@ -906,7 +906,7 @@ cglobal pred8x8_dc_rv40_mmxext, 2,7
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED8x8_TM_MMX 0
+-cglobal pred8x8_tm_vp8, 2,6
++cglobal pred8x8_tm_vp8_8, 2,6
+ sub r0, r1
+ pxor mm7, mm7
+ movq mm0, [r0]
+@@ -946,7 +946,7 @@ INIT_MMX mmx2
+ PRED8x8_TM_MMX
+ INIT_MMX
+
+-cglobal pred8x8_tm_vp8_sse2, 2,6,4
++cglobal pred8x8_tm_vp8_8_sse2, 2,6,4
+ sub r0, r1
+ pxor xmm1, xmm1
+ movq xmm0, [r0]
+@@ -974,7 +974,7 @@ cglobal pred8x8_tm_vp8_sse2, 2,6,4
+ jg .loop
+ REP_RET
+
+-cglobal pred8x8_tm_vp8_ssse3, 2,3,6
++cglobal pred8x8_tm_vp8_8_ssse3, 2,3,6
+ sub r0, r1
+ movdqa xmm4, [tm_shuf]
+ pxor xmm1, xmm1
+@@ -1016,7 +1016,7 @@ cglobal pred8x8_tm_vp8_ssse3, 2,3,6
+ ; void pred8x8l_top_dc(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+ %macro PRED8x8L_TOP_DC 1
+-cglobal pred8x8l_top_dc_%1, 4,4
++cglobal pred8x8l_top_dc_8_%1, 4,4
+ sub r0, r3
+ pxor mm7, mm7
+ movq mm0, [r0-8]
+@@ -1073,7 +1073,7 @@ PRED8x8L_TOP_DC ssse3
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED8x8L_DC 1
+-cglobal pred8x8l_dc_%1, 4,5
++cglobal pred8x8l_dc_8_%1, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1176,7 +1176,7 @@ PRED8x8L_DC ssse3
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED8x8L_HORIZONTAL 1
+-cglobal pred8x8l_horizontal_%1, 4,4
++cglobal pred8x8l_horizontal_8_%1, 4,4
+ sub r0, r3
+ lea r2, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1248,7 +1248,7 @@ PRED8x8L_HORIZONTAL ssse3
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED8x8L_VERTICAL 1
+-cglobal pred8x8l_vertical_%1, 4,4
++cglobal pred8x8l_vertical_8_%1, 4,4
+ sub r0, r3
+ movq mm0, [r0-8]
+ movq mm3, [r0]
+@@ -1300,7 +1300,7 @@ PRED8x8L_VERTICAL ssse3
+
+ INIT_MMX
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred8x8l_down_left_mmxext, 4,5
++cglobal pred8x8l_down_left_8_mmxext, 4,5
+ sub r0, r3
+ movq mm0, [r0-8]
+ movq mm3, [r0]
+@@ -1408,7 +1408,7 @@ cglobal pred8x8l_down_left_mmxext, 4,5
+ RET
+
+ %macro PRED8x8L_DOWN_LEFT 1
+-cglobal pred8x8l_down_left_%1, 4,4
++cglobal pred8x8l_down_left_8_%1, 4,4
+ sub r0, r3
+ movq mm0, [r0-8]
+ movq mm3, [r0]
+@@ -1503,7 +1503,7 @@ PRED8x8L_DOWN_LEFT ssse3
+
+ INIT_MMX
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred8x8l_down_right_mmxext, 4,5
++cglobal pred8x8l_down_right_8_mmxext, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1635,7 +1635,7 @@ cglobal pred8x8l_down_right_mmxext, 4,5
+ RET
+
+ %macro PRED8x8L_DOWN_RIGHT 1
+-cglobal pred8x8l_down_right_%1, 4,5
++cglobal pred8x8l_down_right_8_%1, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1757,7 +1757,7 @@ PRED8x8L_DOWN_RIGHT ssse3
+
+ INIT_MMX
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred8x8l_vertical_right_mmxext, 4,5
++cglobal pred8x8l_vertical_right_8_mmxext, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1864,7 +1864,7 @@ cglobal pred8x8l_vertical_right_mmxext, 4,5
+ RET
+
+ %macro PRED8x8L_VERTICAL_RIGHT 1
+-cglobal pred8x8l_vertical_right_%1, 4,5,7
++cglobal pred8x8l_vertical_right_8_%1, 4,5,7
+ ; manually spill XMM registers for Win64 because
+ ; the code here is initialized with INIT_MMX
+ WIN64_SPILL_XMM 7
+@@ -1986,7 +1986,7 @@ PRED8x8L_VERTICAL_RIGHT ssse3
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED8x8L_VERTICAL_LEFT 1
+-cglobal pred8x8l_vertical_left_%1, 4,4
++cglobal pred8x8l_vertical_left_8_%1, 4,4
+ sub r0, r3
+ movq mm0, [r0-8]
+ movq mm3, [r0]
+@@ -2077,7 +2077,7 @@ PRED8x8L_VERTICAL_LEFT ssse3
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED8x8L_HORIZONTAL_UP 1
+-cglobal pred8x8l_horizontal_up_%1, 4,4
++cglobal pred8x8l_horizontal_up_8_%1, 4,4
+ sub r0, r3
+ lea r2, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -2166,7 +2166,7 @@ PRED8x8L_HORIZONTAL_UP ssse3
+
+ INIT_MMX
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred8x8l_horizontal_down_mmxext, 4,5
++cglobal pred8x8l_horizontal_down_8_mmxext, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -2281,7 +2281,7 @@ cglobal pred8x8l_horizontal_down_mmxext, 4,5
+ RET
+
+ %macro PRED8x8L_HORIZONTAL_DOWN 1
+-cglobal pred8x8l_horizontal_down_%1, 4,5
++cglobal pred8x8l_horizontal_down_8_%1, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -2415,7 +2415,7 @@ PRED8x8L_HORIZONTAL_DOWN ssse3
+ ; void pred4x4_dc_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-cglobal pred4x4_dc_mmxext, 3,5
++cglobal pred4x4_dc_8_mmxext, 3,5
+ pxor mm7, mm7
+ mov r4, r0
+ sub r0, r2
+@@ -2445,7 +2445,7 @@ cglobal pred4x4_dc_mmxext, 3,5
+ ;-----------------------------------------------------------------------------
+
+ %macro PRED4x4_TM_MMX 0
+-cglobal pred4x4_tm_vp8, 3,6
++cglobal pred4x4_tm_vp8_8, 3,6
+ sub r0, r2
+ pxor mm7, mm7
+ movd mm0, [r0]
+@@ -2486,7 +2486,7 @@ INIT_MMX mmx2
+ PRED4x4_TM_MMX
+ INIT_MMX
+
+-cglobal pred4x4_tm_vp8_ssse3, 3,3
++cglobal pred4x4_tm_vp8_8_ssse3, 3,3
+ sub r0, r2
+ movq mm6, [tm_shuf]
+ pxor mm1, mm1
+@@ -2526,7 +2526,7 @@ cglobal pred4x4_tm_vp8_ssse3, 3,3
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX
+-cglobal pred4x4_vertical_vp8_mmxext, 3,3
++cglobal pred4x4_vertical_vp8_8_mmxext, 3,3
+ sub r0, r2
+ movd m1, [r0-1]
+ movd m0, [r0]
+@@ -2545,7 +2545,7 @@ cglobal pred4x4_vertical_vp8_mmxext, 3,3
+ ; void pred4x4_down_left_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+ INIT_MMX
+-cglobal pred4x4_down_left_mmxext, 3,3
++cglobal pred4x4_down_left_8_mmxext, 3,3
+ sub r0, r2
+ movq m1, [r0]
+ punpckldq m1, [r1]
+@@ -2572,7 +2572,7 @@ cglobal pred4x4_down_left_mmxext, 3,3
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX
+-cglobal pred4x4_vertical_left_mmxext, 3,3
++cglobal pred4x4_vertical_left_8_mmxext, 3,3
+ sub r0, r2
+ movq m1, [r0]
+ punpckldq m1, [r1]
+@@ -2597,7 +2597,7 @@ cglobal pred4x4_vertical_left_mmxext, 3,3
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX
+-cglobal pred4x4_horizontal_up_mmxext, 3,3
++cglobal pred4x4_horizontal_up_8_mmxext, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movd m0, [r0+r2*1-4]
+@@ -2631,7 +2631,7 @@ cglobal pred4x4_horizontal_up_mmxext, 3,3
+
+ INIT_MMX
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred4x4_horizontal_down_mmxext, 3,3
++cglobal pred4x4_horizontal_down_8_mmxext, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movh m0, [r0-4] ; lt ..
+@@ -2667,7 +2667,7 @@ cglobal pred4x4_horizontal_down_mmxext, 3,3
+
+ INIT_MMX
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred4x4_vertical_right_mmxext, 3,3
++cglobal pred4x4_vertical_right_8_mmxext, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movh m0, [r0] ; ........t3t2t1t0
+@@ -2698,7 +2698,7 @@ cglobal pred4x4_vertical_right_mmxext, 3,3
+
+ INIT_MMX
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred4x4_down_right_mmxext, 3,3
++cglobal pred4x4_down_right_8_mmxext, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movq m1, [r1-8]
+diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
+index 7a6daac..a686473 100644
+--- a/libavcodec/x86/h264_intrapred_init.c
++++ b/libavcodec/x86/h264_intrapred_init.c
+@@ -94,79 +94,83 @@ PRED16x16(vertical, 10, sse2)
+ PRED16x16(horizontal, 10, mmx2)
+ PRED16x16(horizontal, 10, sse2)
+
+-void ff_pred16x16_vertical_mmx (uint8_t *src, int stride);
+-void ff_pred16x16_vertical_sse (uint8_t *src, int stride);
+-void ff_pred16x16_horizontal_mmx (uint8_t *src, int stride);
+-void ff_pred16x16_horizontal_mmx2 (uint8_t *src, int stride);
+-void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
+-void ff_pred16x16_dc_mmx2 (uint8_t *src, int stride);
+-void ff_pred16x16_dc_sse2 (uint8_t *src, int stride);
+-void ff_pred16x16_dc_ssse3 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_h264_mmx (uint8_t *src, int stride);
+-void ff_pred16x16_plane_h264_mmx2 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_h264_sse2 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_h264_ssse3 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_rv40_mmx (uint8_t *src, int stride);
+-void ff_pred16x16_plane_rv40_mmx2 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_rv40_sse2 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_rv40_ssse3 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_svq3_mmx (uint8_t *src, int stride);
+-void ff_pred16x16_plane_svq3_mmx2 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_svq3_sse2 (uint8_t *src, int stride);
+-void ff_pred16x16_plane_svq3_ssse3 (uint8_t *src, int stride);
+-void ff_pred16x16_tm_vp8_mmx (uint8_t *src, int stride);
+-void ff_pred16x16_tm_vp8_mmx2 (uint8_t *src, int stride);
+-void ff_pred16x16_tm_vp8_sse2 (uint8_t *src, int stride);
+-void ff_pred8x8_top_dc_mmxext (uint8_t *src, int stride);
+-void ff_pred8x8_dc_rv40_mmxext (uint8_t *src, int stride);
+-void ff_pred8x8_dc_mmxext (uint8_t *src, int stride);
+-void ff_pred8x8_vertical_mmx (uint8_t *src, int stride);
+-void ff_pred8x8_horizontal_mmx (uint8_t *src, int stride);
+-void ff_pred8x8_horizontal_mmx2 (uint8_t *src, int stride);
+-void ff_pred8x8_horizontal_ssse3 (uint8_t *src, int stride);
+-void ff_pred8x8_plane_mmx (uint8_t *src, int stride);
+-void ff_pred8x8_plane_mmx2 (uint8_t *src, int stride);
+-void ff_pred8x8_plane_sse2 (uint8_t *src, int stride);
+-void ff_pred8x8_plane_ssse3 (uint8_t *src, int stride);
+-void ff_pred8x8_tm_vp8_mmx (uint8_t *src, int stride);
+-void ff_pred8x8_tm_vp8_mmx2 (uint8_t *src, int stride);
+-void ff_pred8x8_tm_vp8_sse2 (uint8_t *src, int stride);
+-void ff_pred8x8_tm_vp8_ssse3 (uint8_t *src, int stride);
+-void ff_pred8x8l_top_dc_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_top_dc_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_dc_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_dc_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_horizontal_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_horizontal_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_vertical_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_vertical_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_down_left_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_down_left_sse2 (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_down_left_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_down_right_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_down_right_sse2 (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_down_right_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_vertical_right_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_vertical_right_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_vertical_right_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_vertical_left_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_vertical_left_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_horizontal_up_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_horizontal_up_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_horizontal_down_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_horizontal_down_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred8x8l_horizontal_down_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
+-void ff_pred4x4_dc_mmxext (uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_down_left_mmxext (uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_down_right_mmxext (uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_vertical_right_mmxext(uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_tm_vp8_mmx (uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_tm_vp8_mmx2 (uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_tm_vp8_ssse3 (uint8_t *src, const uint8_t *topright, int stride);
+-void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
++/* 8-bit versions */
++PRED16x16(vertical, 8, mmx)
++PRED16x16(vertical, 8, sse)
++PRED16x16(horizontal, 8, mmx)
++PRED16x16(horizontal, 8, mmx2)
++PRED16x16(horizontal, 8, ssse3)
++PRED16x16(dc, 8, mmx2)
++PRED16x16(dc, 8, sse2)
++PRED16x16(dc, 8, ssse3)
++PRED16x16(plane_h264, 8, mmx)
++PRED16x16(plane_h264, 8, mmx2)
++PRED16x16(plane_h264, 8, sse2)
++PRED16x16(plane_h264, 8, ssse3)
++PRED16x16(plane_rv40, 8, mmx)
++PRED16x16(plane_rv40, 8, mmx2)
++PRED16x16(plane_rv40, 8, sse2)
++PRED16x16(plane_rv40, 8, ssse3)
++PRED16x16(plane_svq3, 8, mmx)
++PRED16x16(plane_svq3, 8, mmx2)
++PRED16x16(plane_svq3, 8, sse2)
++PRED16x16(plane_svq3, 8, ssse3)
++PRED16x16(tm_vp8, 8, mmx)
++PRED16x16(tm_vp8, 8, mmx2)
++PRED16x16(tm_vp8, 8, sse2)
++
++PRED8x8(top_dc, 8, mmxext)
++PRED8x8(dc_rv40, 8, mmxext)
++PRED8x8(dc, 8, mmxext)
++PRED8x8(vertical, 8, mmx)
++PRED8x8(horizontal, 8, mmx)
++PRED8x8(horizontal, 8, mmx2)
++PRED8x8(horizontal, 8, ssse3)
++PRED8x8(plane, 8, mmx)
++PRED8x8(plane, 8, mmx2)
++PRED8x8(plane, 8, sse2)
++PRED8x8(plane, 8, ssse3)
++PRED8x8(tm_vp8, 8, mmx)
++PRED8x8(tm_vp8, 8, mmx2)
++PRED8x8(tm_vp8, 8, sse2)
++PRED8x8(tm_vp8, 8, ssse3)
++
++PRED8x8L(top_dc, 8, mmxext)
++PRED8x8L(top_dc, 8, ssse3)
++PRED8x8L(dc, 8, mmxext)
++PRED8x8L(dc, 8, ssse3)
++PRED8x8L(horizontal, 8, mmxext)
++PRED8x8L(horizontal, 8, ssse3)
++PRED8x8L(vertical, 8, mmxext)
++PRED8x8L(vertical, 8, ssse3)
++PRED8x8L(down_left, 8, mmxext)
++PRED8x8L(down_left, 8, sse2)
++PRED8x8L(down_left, 8, ssse3)
++PRED8x8L(down_right, 8, mmxext)
++PRED8x8L(down_right, 8, sse2)
++PRED8x8L(down_right, 8, ssse3)
++PRED8x8L(vertical_right, 8, mmxext)
++PRED8x8L(vertical_right, 8, sse2)
++PRED8x8L(vertical_right, 8, ssse3)
++PRED8x8L(vertical_left, 8, sse2)
++PRED8x8L(vertical_left, 8, ssse3)
++PRED8x8L(horizontal_up, 8, mmxext)
++PRED8x8L(horizontal_up, 8, ssse3)
++PRED8x8L(horizontal_down, 8, mmxext)
++PRED8x8L(horizontal_down, 8, sse2)
++PRED8x8L(horizontal_down, 8, ssse3)
++
++PRED4x4(dc, 8, mmxext)
++PRED4x4(down_left, 8, mmxext)
++PRED4x4(down_right, 8, mmxext)
++PRED4x4(vertical_left, 8, mmxext)
++PRED4x4(vertical_right, 8, mmxext)
++PRED4x4(horizontal_up, 8, mmxext)
++PRED4x4(horizontal_down, 8, mmxext)
++PRED4x4(tm_vp8, 8, mmx)
++PRED4x4(tm_vp8, 8, mmx2)
++PRED4x4(tm_vp8, 8, ssse3)
++PRED4x4(vertical_vp8, 8, mmxext)
+
+ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc)
+ {
+@@ -174,136 +178,136 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth
+
+ if (bit_depth == 8) {
+ if (EXTERNAL_MMX(mm_flags)) {
+- h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_mmx;
+- h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx;
++ h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_8_mmx;
++ h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_mmx;
+ if (chroma_format_idc == 1) {
+- h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x8_vertical_mmx;
+- h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx;
++ h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x8_vertical_8_mmx;
++ h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_mmx;
+ }
+ if (codec_id == AV_CODEC_ID_VP8) {
+- h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_mmx;
+- h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_mmx;
+- h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmx;
++ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_8_mmx;
++ h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_8_mmx;
++ h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_8_mmx;
+ } else {
+ if (chroma_format_idc == 1)
+- h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_mmx;
++ h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_8_mmx;
+ if (codec_id == AV_CODEC_ID_SVQ3) {
+ if (mm_flags & AV_CPU_FLAG_CMOV)
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_mmx;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_8_mmx;
+ } else if (codec_id == AV_CODEC_ID_RV40) {
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_mmx;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_8_mmx;
+ } else {
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_mmx;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_8_mmx;
+ }
+ }
+ }
+
+ if (EXTERNAL_MMXEXT(mm_flags)) {
+- h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx2;
+- h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmx2;
++ h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_mmx2;
++ h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_mmx2;
+ if (chroma_format_idc == 1)
+- h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx2;
+- h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_mmxext;
+- h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_mmxext;
+- h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_mmxext;
+- h->pred8x8l [VERT_PRED ] = ff_pred8x8l_vertical_mmxext;
+- h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_mmxext;
+- h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_mmxext;
+- h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_mmxext;
+- h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_mmxext;
+- h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_mmxext;
+- h->pred4x4 [DIAG_DOWN_RIGHT_PRED ] = ff_pred4x4_down_right_mmxext;
+- h->pred4x4 [VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_mmxext;
+- h->pred4x4 [HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_mmxext;
+- h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_mmxext;
++ h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_mmx2;
++ h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_8_mmxext;
++ h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_8_mmxext;
++ h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_8_mmxext;
++ h->pred8x8l [VERT_PRED ] = ff_pred8x8l_vertical_8_mmxext;
++ h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_8_mmxext;
++ h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_8_mmxext;
++ h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_8_mmxext;
++ h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_8_mmxext;
++ h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_8_mmxext;
++ h->pred4x4 [DIAG_DOWN_RIGHT_PRED ] = ff_pred4x4_down_right_8_mmxext;
++ h->pred4x4 [VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_8_mmxext;
++ h->pred4x4 [HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_8_mmxext;
++ h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_8_mmxext;
+ if (codec_id == AV_CODEC_ID_VP8 || codec_id == AV_CODEC_ID_H264) {
+- h->pred4x4 [DIAG_DOWN_LEFT_PRED] = ff_pred4x4_down_left_mmxext;
++ h->pred4x4 [DIAG_DOWN_LEFT_PRED] = ff_pred4x4_down_left_8_mmxext;
+ }
+ if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
+- h->pred4x4 [VERT_LEFT_PRED ] = ff_pred4x4_vertical_left_mmxext;
++ h->pred4x4 [VERT_LEFT_PRED ] = ff_pred4x4_vertical_left_8_mmxext;
+ }
+ if (codec_id != AV_CODEC_ID_RV40) {
+- h->pred4x4 [HOR_UP_PRED ] = ff_pred4x4_horizontal_up_mmxext;
++ h->pred4x4 [HOR_UP_PRED ] = ff_pred4x4_horizontal_up_8_mmxext;
+ }
+ if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
+ if (chroma_format_idc == 1) {
+- h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_mmxext;
+- h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_mmxext;
++ h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_8_mmxext;
++ h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_8_mmxext;
+ }
+ }
+ if (codec_id == AV_CODEC_ID_VP8) {
+- h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_mmx2;
+- h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext;
+- h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_mmx2;
+- h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmx2;
+- h->pred4x4 [VERT_PRED ] = ff_pred4x4_vertical_vp8_mmxext;
++ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_8_mmx2;
++ h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_8_mmxext;
++ h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_8_mmx2;
++ h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_8_mmx2;
++ h->pred4x4 [VERT_PRED ] = ff_pred4x4_vertical_vp8_8_mmxext;
+ } else {
+ if (chroma_format_idc == 1)
+- h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_mmx2;
++ h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_8_mmx2;
+ if (codec_id == AV_CODEC_ID_SVQ3) {
+- h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_svq3_mmx2;
++ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_svq3_8_mmx2;
+ } else if (codec_id == AV_CODEC_ID_RV40) {
+- h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_rv40_mmx2;
++ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_rv40_8_mmx2;
+ } else {
+- h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_h264_mmx2;
++ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_h264_8_mmx2;
+ }
+ }
+ }
+
+ if (EXTERNAL_SSE(mm_flags)) {
+- h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
++ h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_8_sse;
+ }
+
+ if (EXTERNAL_SSE2(mm_flags)) {
+- h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2;
+- h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_sse2;
+- h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_sse2;
+- h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_sse2;
+- h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_sse2;
+- h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_sse2;
++ h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_sse2;
++ h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_8_sse2;
++ h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_8_sse2;
++ h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_8_sse2;
++ h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_8_sse2;
++ h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_8_sse2;
+ if (codec_id == AV_CODEC_ID_VP8) {
+- h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_sse2;
+- h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_sse2;
++ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_8_sse2;
++ h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_8_sse2;
+ } else {
+ if (chroma_format_idc == 1)
+- h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_sse2;
++ h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_8_sse2;
+ if (codec_id == AV_CODEC_ID_SVQ3) {
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_sse2;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_8_sse2;
+ } else if (codec_id == AV_CODEC_ID_RV40) {
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_sse2;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_8_sse2;
+ } else {
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_sse2;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_8_sse2;
+ }
+ }
+ }
+
+ if (EXTERNAL_SSSE3(mm_flags)) {
+- h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
+- h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3;
++ h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_ssse3;
++ h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_ssse3;
+ if (chroma_format_idc == 1)
+- h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
+- h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_ssse3;
+- h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_ssse3;
+- h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_ssse3;
+- h->pred8x8l [VERT_PRED ] = ff_pred8x8l_vertical_ssse3;
+- h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_ssse3;
+- h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_ssse3;
+- h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_ssse3;
+- h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_ssse3;
+- h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_ssse3;
+- h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_ssse3;
++ h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_ssse3;
++ h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_8_ssse3;
++ h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_8_ssse3;
++ h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_8_ssse3;
++ h->pred8x8l [VERT_PRED ] = ff_pred8x8l_vertical_8_ssse3;
++ h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_8_ssse3;
++ h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_8_ssse3;
++ h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_8_ssse3;
++ h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_8_ssse3;
++ h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_8_ssse3;
++ h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_8_ssse3;
+ if (codec_id == AV_CODEC_ID_VP8) {
+- h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_ssse3;
+- h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_ssse3;
++ h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_8_ssse3;
++ h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_8_ssse3;
+ } else {
+ if (chroma_format_idc == 1)
+- h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_ssse3;
++ h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_8_ssse3;
+ if (codec_id == AV_CODEC_ID_SVQ3) {
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_ssse3;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_8_ssse3;
+ } else if (codec_id == AV_CODEC_ID_RV40) {
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_ssse3;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_8_ssse3;
+ } else {
+- h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_ssse3;
++ h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_8_ssse3;
+ }
+ }
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0079-Use-ptrdiff_t-instead-of-int-for-intra-pred-stride-f.patch b/debian/patches/post-9beta2/0079-Use-ptrdiff_t-instead-of-int-for-intra-pred-stride-f.patch
new file mode 100644
index 0000000..1387d54
--- /dev/null
+++ b/debian/patches/post-9beta2/0079-Use-ptrdiff_t-instead-of-int-for-intra-pred-stride-f.patch
@@ -0,0 +1,1022 @@
+From 95c89da36ebeeb96b7146c0d70f46c582397da7f Mon Sep 17 00:00:00 2001
+From: "Ronald S. Bultje" <rsbultje at gmail.com>
+Date: Sun, 28 Oct 2012 20:44:54 -0700
+Subject: [PATCH 079/204] Use ptrdiff_t instead of int for intra pred "stride"
+ function parameter.
+
+This way, SIMD-optimized functions don't have to sign-extend their
+stride argument manually to be able to do pointer arithmetic.
+---
+ libavcodec/arm/h264pred_init_arm.c | 36 +++---
+ libavcodec/h264pred.c | 79 +++++++++---
+ libavcodec/h264pred.h | 18 +--
+ libavcodec/h264pred_template.c | 233 ++++++++++++++++++++++++----------
+ libavcodec/x86/h264_intrapred_init.c | 15 ++-
+ 5 files changed, 264 insertions(+), 117 deletions(-)
+
+diff --git a/libavcodec/arm/h264pred_init_arm.c b/libavcodec/arm/h264pred_init_arm.c
+index 371b1a6..39c0121 100644
+--- a/libavcodec/arm/h264pred_init_arm.c
++++ b/libavcodec/arm/h264pred_init_arm.c
+@@ -23,25 +23,25 @@
+ #include "libavutil/arm/cpu.h"
+ #include "libavcodec/h264pred.h"
+
+-void ff_pred16x16_vert_neon(uint8_t *src, int stride);
+-void ff_pred16x16_hor_neon(uint8_t *src, int stride);
+-void ff_pred16x16_plane_neon(uint8_t *src, int stride);
+-void ff_pred16x16_dc_neon(uint8_t *src, int stride);
+-void ff_pred16x16_128_dc_neon(uint8_t *src, int stride);
+-void ff_pred16x16_left_dc_neon(uint8_t *src, int stride);
+-void ff_pred16x16_top_dc_neon(uint8_t *src, int stride);
++void ff_pred16x16_vert_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred16x16_hor_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred16x16_plane_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred16x16_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred16x16_128_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred16x16_left_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred16x16_top_dc_neon(uint8_t *src, ptrdiff_t stride);
+
+-void ff_pred8x8_vert_neon(uint8_t *src, int stride);
+-void ff_pred8x8_hor_neon(uint8_t *src, int stride);
+-void ff_pred8x8_plane_neon(uint8_t *src, int stride);
+-void ff_pred8x8_dc_neon(uint8_t *src, int stride);
+-void ff_pred8x8_128_dc_neon(uint8_t *src, int stride);
+-void ff_pred8x8_left_dc_neon(uint8_t *src, int stride);
+-void ff_pred8x8_top_dc_neon(uint8_t *src, int stride);
+-void ff_pred8x8_l0t_dc_neon(uint8_t *src, int stride);
+-void ff_pred8x8_0lt_dc_neon(uint8_t *src, int stride);
+-void ff_pred8x8_l00_dc_neon(uint8_t *src, int stride);
+-void ff_pred8x8_0l0_dc_neon(uint8_t *src, int stride);
++void ff_pred8x8_vert_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_hor_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_plane_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_128_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_left_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_top_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_l0t_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_0lt_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_l00_dc_neon(uint8_t *src, ptrdiff_t stride);
++void ff_pred8x8_0l0_dc_neon(uint8_t *src, ptrdiff_t stride);
+
+ static void ff_h264_pred_init_neon(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc)
+ {
+diff --git a/libavcodec/h264pred.c b/libavcodec/h264pred.c
+index fb44046..94cf9d0 100644
+--- a/libavcodec/h264pred.c
++++ b/libavcodec/h264pred.c
+@@ -39,7 +39,9 @@
+ #include "h264pred_template.c"
+ #undef BIT_DEPTH
+
+-static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ const unsigned lt = src[-1-1*stride];
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+@@ -54,7 +56,9 @@ static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright, int st
+ AV_WN32A(src+3*stride, v);
+ }
+
+-static void pred4x4_horizontal_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_horizontal_vp8_c(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ const unsigned lt = src[-1-1*stride];
+ LOAD_LEFT_EDGE
+
+@@ -64,7 +68,9 @@ static void pred4x4_horizontal_vp8_c(uint8_t *src, const uint8_t *topright, int
+ AV_WN32A(src+3*stride, ((l2 + 2*l3 + l3 + 2) >> 2)*0x01010101);
+ }
+
+-static void pred4x4_down_left_svq3_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_down_left_svq3_c(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ LOAD_TOP_EDGE
+ LOAD_LEFT_EDGE
+
+@@ -86,7 +92,9 @@ static void pred4x4_down_left_svq3_c(uint8_t *src, const uint8_t *topright, int
+ src[3+3*stride]=(l3 + t3)>>1;
+ }
+
+-static void pred4x4_down_left_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_down_left_rv40_c(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+ LOAD_LEFT_EDGE
+@@ -110,7 +118,10 @@ static void pred4x4_down_left_rv40_c(uint8_t *src, const uint8_t *topright, int
+ src[3+3*stride]=(t6 + t7 + 1 + l6 + l7 + 1)>>2;
+ }
+
+-static void pred4x4_down_left_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_down_left_rv40_nodown_c(uint8_t *src,
++ const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+ LOAD_LEFT_EDGE
+@@ -133,8 +144,11 @@ static void pred4x4_down_left_rv40_nodown_c(uint8_t *src, const uint8_t *toprigh
+ src[3+3*stride]=(t6 + t7 + 1 + 2*l3 + 1)>>2;
+ }
+
+-static void pred4x4_vertical_left_rv40(uint8_t *src, const uint8_t *topright, int stride,
+- const int l0, const int l1, const int l2, const int l3, const int l4){
++static void pred4x4_vertical_left_rv40(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride,
++ const int l0, const int l1, const int l2,
++ const int l3, const int l4)
++{
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+
+@@ -156,20 +170,27 @@ static void pred4x4_vertical_left_rv40(uint8_t *src, const uint8_t *topright, in
+ src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
+ }
+
+-static void pred4x4_vertical_left_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_vertical_left_rv40_c(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ LOAD_LEFT_EDGE
+ LOAD_DOWN_LEFT_EDGE
+
+ pred4x4_vertical_left_rv40(src, topright, stride, l0, l1, l2, l3, l4);
+ }
+
+-static void pred4x4_vertical_left_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_vertical_left_rv40_nodown_c(uint8_t *src,
++ const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ LOAD_LEFT_EDGE
+
+ pred4x4_vertical_left_rv40(src, topright, stride, l0, l1, l2, l3, l3);
+ }
+
+-static void pred4x4_vertical_left_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_vertical_left_vp8_c(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+
+@@ -191,7 +212,9 @@ static void pred4x4_vertical_left_vp8_c(uint8_t *src, const uint8_t *topright, i
+ src[3+3*stride]=(t5 + 2*t6 + t7 + 2)>>2;
+ }
+
+-static void pred4x4_horizontal_up_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_horizontal_up_rv40_c(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ LOAD_LEFT_EDGE
+ LOAD_DOWN_LEFT_EDGE
+ LOAD_TOP_EDGE
+@@ -215,7 +238,10 @@ static void pred4x4_horizontal_up_rv40_c(uint8_t *src, const uint8_t *topright,
+ src[3+3*stride]=(l4 + 2*l5 + l6 + 2)>>2;
+ }
+
+-static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src,
++ const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ LOAD_LEFT_EDGE
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+@@ -238,7 +264,9 @@ static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src, const uint8_t *top
+ src[3+3*stride]=l3;
+ }
+
+-static void pred4x4_tm_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
++static void pred4x4_tm_vp8_c(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride)
++{
+ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
+ uint8_t *top = src-stride;
+ int y;
+@@ -253,15 +281,18 @@ static void pred4x4_tm_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
+ }
+ }
+
+-static void pred16x16_plane_svq3_c(uint8_t *src, int stride){
++static void pred16x16_plane_svq3_c(uint8_t *src, ptrdiff_t stride)
++{
+ pred16x16_plane_compat_8_c(src, stride, 1, 0);
+ }
+
+-static void pred16x16_plane_rv40_c(uint8_t *src, int stride){
++static void pred16x16_plane_rv40_c(uint8_t *src, ptrdiff_t stride)
++{
+ pred16x16_plane_compat_8_c(src, stride, 0, 1);
+ }
+
+-static void pred16x16_tm_vp8_c(uint8_t *src, int stride){
++static void pred16x16_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
++{
+ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
+ uint8_t *top = src-stride;
+ int y;
+@@ -288,7 +319,8 @@ static void pred16x16_tm_vp8_c(uint8_t *src, int stride){
+ }
+ }
+
+-static void pred8x8_left_dc_rv40_c(uint8_t *src, int stride){
++static void pred8x8_left_dc_rv40_c(uint8_t *src, ptrdiff_t stride)
++{
+ int i;
+ unsigned dc0;
+
+@@ -303,7 +335,8 @@ static void pred8x8_left_dc_rv40_c(uint8_t *src, int stride){
+ }
+ }
+
+-static void pred8x8_top_dc_rv40_c(uint8_t *src, int stride){
++static void pred8x8_top_dc_rv40_c(uint8_t *src, ptrdiff_t stride)
++{
+ int i;
+ unsigned dc0;
+
+@@ -318,7 +351,8 @@ static void pred8x8_top_dc_rv40_c(uint8_t *src, int stride){
+ }
+ }
+
+-static void pred8x8_dc_rv40_c(uint8_t *src, int stride){
++static void pred8x8_dc_rv40_c(uint8_t *src, ptrdiff_t stride)
++{
+ int i;
+ unsigned dc0 = 0;
+
+@@ -339,7 +373,8 @@ static void pred8x8_dc_rv40_c(uint8_t *src, int stride){
+ }
+ }
+
+-static void pred8x8_tm_vp8_c(uint8_t *src, int stride){
++static void pred8x8_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
++{
+ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
+ uint8_t *top = src-stride;
+ int y;
+@@ -361,7 +396,9 @@ static void pred8x8_tm_vp8_c(uint8_t *src, int stride){
+ /**
+ * Set the intra prediction function pointers.
+ */
+-void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc){
++void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth,
++ const int chroma_format_idc)
++{
+ // MpegEncContext * const s = &h->s;
+
+ #undef FUNC
+diff --git a/libavcodec/h264pred.h b/libavcodec/h264pred.h
+index a964ae3..a8b3dba 100644
+--- a/libavcodec/h264pred.h
++++ b/libavcodec/h264pred.h
+@@ -90,21 +90,23 @@
+ * Context for storing H.264 prediction functions
+ */
+ typedef struct H264PredContext {
+- void(*pred4x4[9 + 3 + 3])(uint8_t *src, const uint8_t *topright, int stride); //FIXME move to dsp?
+- void(*pred8x8l[9 + 3])(uint8_t *src, int topleft, int topright, int stride);
+- void(*pred8x8[4 + 3 + 4])(uint8_t *src, int stride);
+- void(*pred16x16[4 + 3 + 2])(uint8_t *src, int stride);
++ void(*pred4x4[9 + 3 + 3])(uint8_t *src, const uint8_t *topright,
++ ptrdiff_t stride);
++ void(*pred8x8l[9 + 3])(uint8_t *src, int topleft, int topright,
++ ptrdiff_t stride);
++ void(*pred8x8[4 + 3 + 4])(uint8_t *src, ptrdiff_t stride);
++ void(*pred16x16[4 + 3 + 2])(uint8_t *src, ptrdiff_t stride);
+
+ void(*pred4x4_add[2])(uint8_t *pix /*align 4*/,
+- const DCTELEM *block /*align 16*/, int stride);
++ const DCTELEM *block /*align 16*/, ptrdiff_t stride);
+ void(*pred8x8l_add[2])(uint8_t *pix /*align 8*/,
+- const DCTELEM *block /*align 16*/, int stride);
++ const DCTELEM *block /*align 16*/, ptrdiff_t stride);
+ void(*pred8x8_add[3])(uint8_t *pix /*align 8*/,
+ const int *block_offset,
+- const DCTELEM *block /*align 16*/, int stride);
++ const DCTELEM *block /*align 16*/, ptrdiff_t stride);
+ void(*pred16x16_add[3])(uint8_t *pix /*align 16*/,
+ const int *block_offset,
+- const DCTELEM *block /*align 16*/, int stride);
++ const DCTELEM *block /*align 16*/, ptrdiff_t stride);
+ } H264PredContext;
+
+ void ff_h264_pred_init(H264PredContext *h, int codec_id,
+diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c
+index 19100b6..8ae13b0 100644
+--- a/libavcodec/h264pred_template.c
++++ b/libavcodec/h264pred_template.c
+@@ -29,7 +29,9 @@
+
+ #include "bit_depth_template.c"
+
+-static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const pixel4 a= AV_RN4PA(src-stride);
+@@ -40,7 +42,9 @@ static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, int
+ AV_WN4PA(src+3*stride, a);
+ }
+
+-static void FUNCC(pred4x4_horizontal)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_horizontal)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ AV_WN4PA(src+0*stride, PIXEL_SPLAT_X4(src[-1+0*stride]));
+@@ -49,7 +53,9 @@ static void FUNCC(pred4x4_horizontal)(uint8_t *_src, const uint8_t *topright, in
+ AV_WN4PA(src+3*stride, PIXEL_SPLAT_X4(src[-1+3*stride]));
+ }
+
+-static void FUNCC(pred4x4_dc)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_dc)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const int dc= ( src[-stride] + src[1-stride] + src[2-stride] + src[3-stride]
+@@ -62,7 +68,9 @@ static void FUNCC(pred4x4_dc)(uint8_t *_src, const uint8_t *topright, int _strid
+ AV_WN4PA(src+3*stride, a);
+ }
+
+-static void FUNCC(pred4x4_left_dc)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_left_dc)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const int dc= ( src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;
+@@ -74,7 +82,9 @@ static void FUNCC(pred4x4_left_dc)(uint8_t *_src, const uint8_t *topright, int _
+ AV_WN4PA(src+3*stride, a);
+ }
+
+-static void FUNCC(pred4x4_top_dc)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_top_dc)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const int dc= ( src[-stride] + src[1-stride] + src[2-stride] + src[3-stride] + 2) >>2;
+@@ -86,7 +96,9 @@ static void FUNCC(pred4x4_top_dc)(uint8_t *_src, const uint8_t *topright, int _s
+ AV_WN4PA(src+3*stride, a);
+ }
+
+-static void FUNCC(pred4x4_128_dc)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_128_dc)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const pixel4 a = PIXEL_SPLAT_X4(1<<(BIT_DEPTH-1));
+@@ -97,7 +109,9 @@ static void FUNCC(pred4x4_128_dc)(uint8_t *_src, const uint8_t *topright, int _s
+ AV_WN4PA(src+3*stride, a);
+ }
+
+-static void FUNCC(pred4x4_127_dc)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_127_dc)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const pixel4 a = PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))-1);
+@@ -108,7 +122,9 @@ static void FUNCC(pred4x4_127_dc)(uint8_t *_src, const uint8_t *topright, int _s
+ AV_WN4PA(src+3*stride, a);
+ }
+
+-static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const pixel4 a = PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))+1);
+@@ -144,7 +160,9 @@ static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright, int _s
+ const unsigned av_unused t2 = src[ 2-1*stride];\
+ const unsigned av_unused t3 = src[ 3-1*stride];\
+
+-static void FUNCC(pred4x4_down_right)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_down_right)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const int lt= src[-1-1*stride];
+@@ -169,7 +187,9 @@ static void FUNCC(pred4x4_down_right)(uint8_t *_src, const uint8_t *topright, in
+ src[3+0*stride]=(t1 + 2*t2 + t3 + 2)>>2;
+ }
+
+-static void FUNCC(pred4x4_down_left)(uint8_t *_src, const uint8_t *_topright, int _stride){
++static void FUNCC(pred4x4_down_left)(uint8_t *_src, const uint8_t *_topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ const pixel *topright = (const pixel*)_topright;
+ int stride = _stride/sizeof(pixel);
+@@ -195,7 +215,10 @@ static void FUNCC(pred4x4_down_left)(uint8_t *_src, const uint8_t *_topright, in
+ src[3+3*stride]=(t6 + 3*t7 + 2)>>2;
+ }
+
+-static void FUNCC(pred4x4_vertical_right)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_vertical_right)(uint8_t *_src,
++ const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const int lt= src[-1-1*stride];
+@@ -220,7 +243,10 @@ static void FUNCC(pred4x4_vertical_right)(uint8_t *_src, const uint8_t *topright
+ src[0+3*stride]=(l0 + 2*l1 + l2 + 2)>>2;
+ }
+
+-static void FUNCC(pred4x4_vertical_left)(uint8_t *_src, const uint8_t *_topright, int _stride){
++static void FUNCC(pred4x4_vertical_left)(uint8_t *_src,
++ const uint8_t *_topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ const pixel *topright = (const pixel*)_topright;
+ int stride = _stride/sizeof(pixel);
+@@ -245,7 +271,9 @@ static void FUNCC(pred4x4_vertical_left)(uint8_t *_src, const uint8_t *_topright
+ src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
+ }
+
+-static void FUNCC(pred4x4_horizontal_up)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_horizontal_up)(uint8_t *_src, const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ LOAD_LEFT_EDGE
+@@ -268,7 +296,10 @@ static void FUNCC(pred4x4_horizontal_up)(uint8_t *_src, const uint8_t *topright,
+ src[3+3*stride]=l3;
+ }
+
+-static void FUNCC(pred4x4_horizontal_down)(uint8_t *_src, const uint8_t *topright, int _stride){
++static void FUNCC(pred4x4_horizontal_down)(uint8_t *_src,
++ const uint8_t *topright,
++ ptrdiff_t _stride)
++{
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+ const int lt= src[-1-1*stride];
+@@ -293,7 +324,8 @@ static void FUNCC(pred4x4_horizontal_down)(uint8_t *_src, const uint8_t *toprigh
+ src[1+3*stride]=(l1 + 2*l2 + l3 + 2)>>2;
+ }
+
+-static void FUNCC(pred16x16_vertical)(uint8_t *_src, int _stride){
++static void FUNCC(pred16x16_vertical)(uint8_t *_src, ptrdiff_t _stride)
++{
+ int i;
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -310,7 +342,8 @@ static void FUNCC(pred16x16_vertical)(uint8_t *_src, int _stride){
+ }
+ }
+
+-static void FUNCC(pred16x16_horizontal)(uint8_t *_src, int stride){
++static void FUNCC(pred16x16_horizontal)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i;
+ pixel *src = (pixel*)_src;
+ stride /= sizeof(pixel);
+@@ -334,7 +367,8 @@ static void FUNCC(pred16x16_horizontal)(uint8_t *_src, int stride){
+ src += stride;\
+ }
+
+-static void FUNCC(pred16x16_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred16x16_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i, dc=0;
+ pixel *src = (pixel*)_src;
+ pixel4 dcsplat;
+@@ -352,7 +386,8 @@ static void FUNCC(pred16x16_dc)(uint8_t *_src, int stride){
+ PREDICT_16x16_DC(dcsplat);
+ }
+
+-static void FUNCC(pred16x16_left_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred16x16_left_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i, dc=0;
+ pixel *src = (pixel*)_src;
+ pixel4 dcsplat;
+@@ -366,7 +401,8 @@ static void FUNCC(pred16x16_left_dc)(uint8_t *_src, int stride){
+ PREDICT_16x16_DC(dcsplat);
+ }
+
+-static void FUNCC(pred16x16_top_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred16x16_top_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i, dc=0;
+ pixel *src = (pixel*)_src;
+ pixel4 dcsplat;
+@@ -381,7 +417,8 @@ static void FUNCC(pred16x16_top_dc)(uint8_t *_src, int stride){
+ }
+
+ #define PRED16x16_X(n, v) \
+-static void FUNCC(pred16x16_##n##_dc)(uint8_t *_src, int stride){\
++static void FUNCC(pred16x16_##n##_dc)(uint8_t *_src, ptrdiff_t stride)\
++{\
+ int i;\
+ pixel *src = (pixel*)_src;\
+ stride /= sizeof(pixel);\
+@@ -392,7 +429,11 @@ PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1)
+ PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0)
+ PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1)
+
+-static inline void FUNCC(pred16x16_plane_compat)(uint8_t *_src, int _stride, const int svq3, const int rv40){
++static inline void FUNCC(pred16x16_plane_compat)(uint8_t *_src,
++ ptrdiff_t _stride,
++ const int svq3,
++ const int rv40)
++{
+ int i, j, k;
+ int a;
+ INIT_CLIP
+@@ -437,11 +478,13 @@ static inline void FUNCC(pred16x16_plane_compat)(uint8_t *_src, int _stride, con
+ }
+ }
+
+-static void FUNCC(pred16x16_plane)(uint8_t *src, int stride){
++static void FUNCC(pred16x16_plane)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred16x16_plane_compat)(src, stride, 0, 0);
+ }
+
+-static void FUNCC(pred8x8_vertical)(uint8_t *_src, int _stride){
++static void FUNCC(pred8x8_vertical)(uint8_t *_src, ptrdiff_t _stride)
++{
+ int i;
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -454,7 +497,8 @@ static void FUNCC(pred8x8_vertical)(uint8_t *_src, int _stride){
+ }
+ }
+
+-static void FUNCC(pred8x16_vertical)(uint8_t *_src, int _stride){
++static void FUNCC(pred8x16_vertical)(uint8_t *_src, ptrdiff_t _stride)
++{
+ int i;
+ pixel *src = (pixel*)_src;
+ int stride = _stride>>(sizeof(pixel)-1);
+@@ -467,7 +511,8 @@ static void FUNCC(pred8x16_vertical)(uint8_t *_src, int _stride){
+ }
+ }
+
+-static void FUNCC(pred8x8_horizontal)(uint8_t *_src, int stride){
++static void FUNCC(pred8x8_horizontal)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i;
+ pixel *src = (pixel*)_src;
+ stride /= sizeof(pixel);
+@@ -479,7 +524,8 @@ static void FUNCC(pred8x8_horizontal)(uint8_t *_src, int stride){
+ }
+ }
+
+-static void FUNCC(pred8x16_horizontal)(uint8_t *_src, int stride){
++static void FUNCC(pred8x16_horizontal)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i;
+ pixel *src = (pixel*)_src;
+ stride >>= sizeof(pixel)-1;
+@@ -491,7 +537,8 @@ static void FUNCC(pred8x16_horizontal)(uint8_t *_src, int stride){
+ }
+
+ #define PRED8x8_X(n, v)\
+-static void FUNCC(pred8x8_##n##_dc)(uint8_t *_src, int stride){\
++static void FUNCC(pred8x8_##n##_dc)(uint8_t *_src, ptrdiff_t stride)\
++{\
+ int i;\
+ const pixel4 a = PIXEL_SPLAT_X4(v);\
+ pixel *src = (pixel*)_src;\
+@@ -506,12 +553,14 @@ PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1)
+ PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0)
+ PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1)
+
+-static void FUNCC(pred8x16_128_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred8x16_128_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ FUNCC(pred8x8_128_dc)(_src, stride);
+ FUNCC(pred8x8_128_dc)(_src+8*stride, stride);
+ }
+
+-static void FUNCC(pred8x8_left_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred8x8_left_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i;
+ int dc0, dc2;
+ pixel4 dc0splat, dc2splat;
+@@ -536,12 +585,14 @@ static void FUNCC(pred8x8_left_dc)(uint8_t *_src, int stride){
+ }
+ }
+
+-static void FUNCC(pred8x16_left_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred8x16_left_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ FUNCC(pred8x8_left_dc)(_src, stride);
+ FUNCC(pred8x8_left_dc)(_src+8*stride, stride);
+ }
+
+-static void FUNCC(pred8x8_top_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred8x8_top_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i;
+ int dc0, dc1;
+ pixel4 dc0splat, dc1splat;
+@@ -566,7 +617,8 @@ static void FUNCC(pred8x8_top_dc)(uint8_t *_src, int stride){
+ }
+ }
+
+-static void FUNCC(pred8x16_top_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred8x16_top_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i;
+ int dc0, dc1;
+ pixel4 dc0splat, dc1splat;
+@@ -587,7 +639,8 @@ static void FUNCC(pred8x16_top_dc)(uint8_t *_src, int stride){
+ }
+ }
+
+-static void FUNCC(pred8x8_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred8x8_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i;
+ int dc0, dc1, dc2;
+ pixel4 dc0splat, dc1splat, dc2splat, dc3splat;
+@@ -615,7 +668,8 @@ static void FUNCC(pred8x8_dc)(uint8_t *_src, int stride){
+ }
+ }
+
+-static void FUNCC(pred8x16_dc)(uint8_t *_src, int stride){
++static void FUNCC(pred8x16_dc)(uint8_t *_src, ptrdiff_t stride)
++{
+ int i;
+ int dc0, dc1, dc2, dc3, dc4;
+ pixel4 dc0splat, dc1splat, dc2splat, dc3splat, dc4splat, dc5splat, dc6splat, dc7splat;
+@@ -657,51 +711,60 @@ static void FUNCC(pred8x16_dc)(uint8_t *_src, int stride){
+ }
+ }
+
+-static void FUNC(pred8x8_mad_cow_dc_l0t)(uint8_t *src, int stride){
++static void FUNC(pred8x8_mad_cow_dc_l0t)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred8x8_top_dc)(src, stride);
+ FUNCC(pred4x4_dc)(src, NULL, stride);
+ }
+
+-static void FUNC(pred8x16_mad_cow_dc_l0t)(uint8_t *src, int stride){
++static void FUNC(pred8x16_mad_cow_dc_l0t)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred8x16_top_dc)(src, stride);
+ FUNCC(pred4x4_dc)(src, NULL, stride);
+ }
+
+-static void FUNC(pred8x8_mad_cow_dc_0lt)(uint8_t *src, int stride){
++static void FUNC(pred8x8_mad_cow_dc_0lt)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred8x8_dc)(src, stride);
+ FUNCC(pred4x4_top_dc)(src, NULL, stride);
+ }
+
+-static void FUNC(pred8x16_mad_cow_dc_0lt)(uint8_t *src, int stride){
++static void FUNC(pred8x16_mad_cow_dc_0lt)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred8x16_dc)(src, stride);
+ FUNCC(pred4x4_top_dc)(src, NULL, stride);
+ }
+
+-static void FUNC(pred8x8_mad_cow_dc_l00)(uint8_t *src, int stride){
++static void FUNC(pred8x8_mad_cow_dc_l00)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred8x8_left_dc)(src, stride);
+ FUNCC(pred4x4_128_dc)(src + 4*stride , NULL, stride);
+ FUNCC(pred4x4_128_dc)(src + 4*stride + 4*sizeof(pixel), NULL, stride);
+ }
+
+-static void FUNC(pred8x16_mad_cow_dc_l00)(uint8_t *src, int stride){
++static void FUNC(pred8x16_mad_cow_dc_l00)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred8x16_left_dc)(src, stride);
+ FUNCC(pred4x4_128_dc)(src + 4*stride , NULL, stride);
+ FUNCC(pred4x4_128_dc)(src + 4*stride + 4*sizeof(pixel), NULL, stride);
+ }
+
+-static void FUNC(pred8x8_mad_cow_dc_0l0)(uint8_t *src, int stride){
++static void FUNC(pred8x8_mad_cow_dc_0l0)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred8x8_left_dc)(src, stride);
+ FUNCC(pred4x4_128_dc)(src , NULL, stride);
+ FUNCC(pred4x4_128_dc)(src + 4*sizeof(pixel), NULL, stride);
+ }
+
+-static void FUNC(pred8x16_mad_cow_dc_0l0)(uint8_t *src, int stride){
++static void FUNC(pred8x16_mad_cow_dc_0l0)(uint8_t *src, ptrdiff_t stride)
++{
+ FUNCC(pred8x16_left_dc)(src, stride);
+ FUNCC(pred4x4_128_dc)(src , NULL, stride);
+ FUNCC(pred4x4_128_dc)(src + 4*sizeof(pixel), NULL, stride);
+ }
+
+-static void FUNCC(pred8x8_plane)(uint8_t *_src, int _stride){
++static void FUNCC(pred8x8_plane)(uint8_t *_src, ptrdiff_t _stride)
++{
+ int j, k;
+ int a;
+ INIT_CLIP
+@@ -736,7 +799,8 @@ static void FUNCC(pred8x8_plane)(uint8_t *_src, int _stride){
+ }
+ }
+
+-static void FUNCC(pred8x16_plane)(uint8_t *_src, int _stride){
++static void FUNCC(pred8x16_plane)(uint8_t *_src, ptrdiff_t _stride)
++{
+ int j, k;
+ int a;
+ INIT_CLIP
+@@ -815,14 +879,16 @@ static void FUNCC(pred8x16_plane)(uint8_t *_src, int _stride){
+ src += stride; \
+ }
+
+-static void FUNCC(pred8x8l_128_dc)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_128_dc)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+
+ PREDICT_8x8_DC(PIXEL_SPLAT_X4(1<<(BIT_DEPTH-1)));
+ }
+-static void FUNCC(pred8x8l_left_dc)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_left_dc)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -831,7 +897,8 @@ static void FUNCC(pred8x8l_left_dc)(uint8_t *_src, int has_topleft, int has_topr
+ const pixel4 dc = PIXEL_SPLAT_X4((l0+l1+l2+l3+l4+l5+l6+l7+4) >> 3);
+ PREDICT_8x8_DC(dc);
+ }
+-static void FUNCC(pred8x8l_top_dc)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_top_dc)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -840,7 +907,8 @@ static void FUNCC(pred8x8l_top_dc)(uint8_t *_src, int has_topleft, int has_topri
+ const pixel4 dc = PIXEL_SPLAT_X4((t0+t1+t2+t3+t4+t5+t6+t7+4) >> 3);
+ PREDICT_8x8_DC(dc);
+ }
+-static void FUNCC(pred8x8l_dc)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_dc)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -851,7 +919,8 @@ static void FUNCC(pred8x8l_dc)(uint8_t *_src, int has_topleft, int has_topright,
+ +t0+t1+t2+t3+t4+t5+t6+t7+8) >> 4);
+ PREDICT_8x8_DC(dc);
+ }
+-static void FUNCC(pred8x8l_horizontal)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_horizontal)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -864,7 +933,8 @@ static void FUNCC(pred8x8l_horizontal)(uint8_t *_src, int has_topleft, int has_t
+ ROW(0); ROW(1); ROW(2); ROW(3); ROW(4); ROW(5); ROW(6); ROW(7);
+ #undef ROW
+ }
+-static void FUNCC(pred8x8l_vertical)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_vertical)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ int y;
+ pixel *src = (pixel*)_src;
+@@ -887,7 +957,8 @@ static void FUNCC(pred8x8l_vertical)(uint8_t *_src, int has_topleft, int has_top
+ AV_WN4PA(((pixel4*)(src+y*stride))+1, b);
+ }
+ }
+-static void FUNCC(pred8x8l_down_left)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_down_left)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -909,7 +980,8 @@ static void FUNCC(pred8x8l_down_left)(uint8_t *_src, int has_topleft, int has_to
+ SRC(6,7)=SRC(7,6)= (t13 + 2*t14 + t15 + 2) >> 2;
+ SRC(7,7)= (t14 + 3*t15 + 2) >> 2;
+ }
+-static void FUNCC(pred8x8l_down_right)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_down_right)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -932,7 +1004,8 @@ static void FUNCC(pred8x8l_down_right)(uint8_t *_src, int has_topleft, int has_t
+ SRC(6,0)=SRC(7,1)= (t4 + 2*t5 + t6 + 2) >> 2;
+ SRC(7,0)= (t5 + 2*t6 + t7 + 2) >> 2;
+ }
+-static void FUNCC(pred8x8l_vertical_right)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_vertical_right)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -962,7 +1035,8 @@ static void FUNCC(pred8x8l_vertical_right)(uint8_t *_src, int has_topleft, int h
+ SRC(7,1)= (t5 + 2*t6 + t7 + 2) >> 2;
+ SRC(7,0)= (t6 + t7 + 1) >> 1;
+ }
+-static void FUNCC(pred8x8l_horizontal_down)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_horizontal_down)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -992,7 +1066,8 @@ static void FUNCC(pred8x8l_horizontal_down)(uint8_t *_src, int has_topleft, int
+ SRC(6,0)= (t5 + 2*t4 + t3 + 2) >> 2;
+ SRC(7,0)= (t6 + 2*t5 + t4 + 2) >> 2;
+ }
+-static void FUNCC(pred8x8l_vertical_left)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_vertical_left)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -1021,7 +1096,8 @@ static void FUNCC(pred8x8l_vertical_left)(uint8_t *_src, int has_topleft, int ha
+ SRC(7,6)= (t10 + t11 + 1) >> 1;
+ SRC(7,7)= (t10 + 2*t11 + t12 + 2) >> 2;
+ }
+-static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft, int has_topright, int _stride)
++static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft,
++ int has_topright, ptrdiff_t _stride)
+ {
+ pixel *src = (pixel*)_src;
+ int stride = _stride/sizeof(pixel);
+@@ -1055,7 +1131,9 @@ static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft, int ha
+ #undef PL
+ #undef SRC
+
+-static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block, int stride){
++static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block,
++ ptrdiff_t stride)
++{
+ int i;
+ pixel *pix = (pixel*)_pix;
+ const dctcoef *block = (const dctcoef*)_block;
+@@ -1072,7 +1150,9 @@ static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block, in
+ }
+ }
+
+-static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, int stride){
++static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,
++ ptrdiff_t stride)
++{
+ int i;
+ pixel *pix = (pixel*)_pix;
+ const dctcoef *block = (const dctcoef*)_block;
+@@ -1088,7 +1168,9 @@ static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,
+ }
+ }
+
+-static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block, int stride){
++static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block,
++ ptrdiff_t stride)
++{
+ int i;
+ pixel *pix = (pixel*)_pix;
+ const dctcoef *block = (const dctcoef*)_block;
+@@ -1109,7 +1191,9 @@ static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block, i
+ }
+ }
+
+-static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, int stride){
++static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,
++ ptrdiff_t stride)
++{
+ int i;
+ pixel *pix = (pixel*)_pix;
+ const dctcoef *block = (const dctcoef*)_block;
+@@ -1129,25 +1213,36 @@ static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,
+ }
+ }
+
+-static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
++static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset,
++ const DCTELEM *block,
++ ptrdiff_t stride)
++{
+ int i;
+ for(i=0; i<16; i++)
+ FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
+ }
+
+-static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
++static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix,
++ const int *block_offset,
++ const DCTELEM *block,
++ ptrdiff_t stride)
++{
+ int i;
+ for(i=0; i<16; i++)
+ FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
+ }
+
+-static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
++static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset,
++ const DCTELEM *block, ptrdiff_t stride)
++{
+ int i;
+ for(i=0; i<4; i++)
+ FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
+ }
+
+-static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
++static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset,
++ const DCTELEM *block, ptrdiff_t stride)
++{
+ int i;
+ for(i=0; i<4; i++)
+ FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
+@@ -1155,13 +1250,19 @@ static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset,
+ FUNCC(pred4x4_vertical_add)(pix + block_offset[i+4], block + i*16*sizeof(pixel), stride);
+ }
+
+-static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
++static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset,
++ const DCTELEM *block,
++ ptrdiff_t stride)
++{
+ int i;
+ for(i=0; i<4; i++)
+ FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
+ }
+
+-static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
++static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix,
++ const int *block_offset,
++ const DCTELEM *block, ptrdiff_t stride)
++{
+ int i;
+ for(i=0; i<4; i++)
+ FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
+diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
+index a686473..eebd137 100644
+--- a/libavcodec/x86/h264_intrapred_init.c
++++ b/libavcodec/x86/h264_intrapred_init.c
+@@ -23,7 +23,9 @@
+ #include "libavcodec/h264pred.h"
+
+ #define PRED4x4(TYPE, DEPTH, OPT) \
+-void ff_pred4x4_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, const uint8_t *topright, int stride);
++void ff_pred4x4_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, \
++ const uint8_t *topright, \
++ ptrdiff_t stride);
+
+ PRED4x4(dc, 10, mmx2)
+ PRED4x4(down_left, 10, sse2)
+@@ -42,7 +44,8 @@ PRED4x4(horizontal_down, 10, ssse3)
+ PRED4x4(horizontal_down, 10, avx)
+
+ #define PRED8x8(TYPE, DEPTH, OPT) \
+-void ff_pred8x8_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
++void ff_pred8x8_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, \
++ ptrdiff_t stride);
+
+ PRED8x8(dc, 10, mmx2)
+ PRED8x8(dc, 10, sse2)
+@@ -52,7 +55,10 @@ PRED8x8(vertical, 10, sse2)
+ PRED8x8(horizontal, 10, sse2)
+
+ #define PRED8x8L(TYPE, DEPTH, OPT)\
+-void ff_pred8x8l_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int has_topleft, int has_topright, int stride);
++void ff_pred8x8l_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, \
++ int has_topleft, \
++ int has_topright, \
++ ptrdiff_t stride);
+
+ PRED8x8L(dc, 10, sse2)
+ PRED8x8L(dc, 10, avx)
+@@ -79,7 +85,8 @@ PRED8x8L(horizontal_up, 10, ssse3)
+ PRED8x8L(horizontal_up, 10, avx)
+
+ #define PRED16x16(TYPE, DEPTH, OPT)\
+-void ff_pred16x16_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
++void ff_pred16x16_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, \
++ ptrdiff_t stride);
+
+ PRED16x16(dc, 10, mmx2)
+ PRED16x16(dc, 10, sse2)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0080-FATE-fix-AD-PCM-test-dependencies-broken-in-e519990.patch b/debian/patches/post-9beta2/0080-FATE-fix-AD-PCM-test-dependencies-broken-in-e519990.patch
new file mode 100644
index 0000000..33e74ff
--- /dev/null
+++ b/debian/patches/post-9beta2/0080-FATE-fix-AD-PCM-test-dependencies-broken-in-e519990.patch
@@ -0,0 +1,36 @@
+From 02e636425970fc9b9aebb31dcc7abbd36e54af2a Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Mon, 29 Oct 2012 21:26:46 +0100
+Subject: [PATCH 080/204] FATE: fix (AD)PCM test dependencies broken in
+ e519990
+
+Signed-off-by: Diego Biurrun <diego at biurrun.de>
+---
+ tests/fate/acodec.mak | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
+index 531f2f3..71521ab 100644
+--- a/tests/fate/acodec.mak
++++ b/tests/fate/acodec.mak
+@@ -19,7 +19,7 @@ FATE_ACODEC_PCM-$(call ENCDEC, PCM_F64BE, AU) += f64be
+ FATE_ACODEC_PCM-$(call ENCDEC, PCM_F64LE, WAV) += f64le
+
+ FATE_ACODEC_PCM := $(FATE_ACODEC_PCM-yes:%=fate-acodec-pcm-%)
+-FATE_AVCONV += $(FATE_ACODEC_PCM)
++FATE_ACODEC += $(FATE_ACODEC_PCM)
+ fate-acodec-pcm: $(FATE_ACODEC_PCM)
+
+ fate-acodec-pcm-%: FMT = wav
+@@ -37,7 +37,7 @@ FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_SWF, FLV) += swf
+ FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_YAMAHA, WAV) += yamaha
+
+ FATE_ACODEC_ADPCM := $(FATE_ACODEC_ADPCM-yes:%=fate-acodec-adpcm-%)
+-FATE_AVCONV += $(FATE_ACODEC_ADPCM)
++FATE_ACODEC += $(FATE_ACODEC_ADPCM)
+ fate-acodec-adpcm: $(FATE_ACODEC_ADPCM)
+
+ fate-acodec-adpcm-%: CODEC = adpcm_$(@:fate-acodec-adpcm-%=%)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0081-configure-rewrite-print_config-function-using-awk.patch b/debian/patches/post-9beta2/0081-configure-rewrite-print_config-function-using-awk.patch
new file mode 100644
index 0000000..000f62b
--- /dev/null
+++ b/debian/patches/post-9beta2/0081-configure-rewrite-print_config-function-using-awk.patch
@@ -0,0 +1,71 @@
+From f454e879238ce317c6d905d187e7608c461a7087 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Sat, 27 Oct 2012 16:43:12 +0100
+Subject: [PATCH 081/204] configure: rewrite print_config() function using awk
+
+This is much faster with slow shells and noticeably faster even
+with bash on a fast Linux system.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 40 +++++++++++++++++++---------------------
+ 1 file changed, 19 insertions(+), 21 deletions(-)
+
+diff --git a/configure b/configure
+index 2abc465..f215c76 100755
+--- a/configure
++++ b/configure
+@@ -566,31 +566,29 @@ check_deps(){
+ done
+ }
+
+-print_config_h(){
+- enabled $1 && v=1 || v=0
+- echo "#define $2 $v"
+-}
+-
+-print_config_mak(){
+- enabled $1 && v= || v=!
+- echo "$v$2=yes"
+-}
+-
+-print_config_asm(){
+- enabled $1 && v=1 || v=0
+- echo "%define $2 $v"
+-}
+-
+ print_config(){
+ pfx=$1
+ files=$2
+ shift 2
+- for cfg; do
+- ucname="$(toupper $cfg)"
+- for f in $files; do
+- "print_config_${f##*.}" $cfg ${pfx}${ucname} >>$f
+- done
+- done
++ map 'eval echo "$v \${$v:-no}"' "$@" |
++ awk "BEGIN { split(\"$files\", files) }
++ {
++ c = \"$pfx\" toupper(\$1);
++ v = \$2;
++ sub(/yes/, 1, v);
++ sub(/no/, 0, v);
++ for (f in files) {
++ file = files[f];
++ if (file ~ /\\.h\$/) {
++ printf(\"#define %s %d\\n\", c, v) >>file;
++ } else if (file ~ /\\.asm\$/) {
++ printf(\"%%define %s %d\\n\", c, v) >>file;
++ } else if (file ~ /\\.mak\$/) {
++ n = +v ? \"\" : \"!\";
++ printf(\"%s%s=yes\\n\", n, c) >>file;
++ }
++ }
++ }"
+ }
+
+ print_enabled(){
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0082-swscale-support-gray-to-9bit-and-10bit-formats.patch b/debian/patches/post-9beta2/0082-swscale-support-gray-to-9bit-and-10bit-formats.patch
new file mode 100644
index 0000000..b753e94
--- /dev/null
+++ b/debian/patches/post-9beta2/0082-swscale-support-gray-to-9bit-and-10bit-formats.patch
@@ -0,0 +1,122 @@
+From 26b5ad2543305f0b148e5b91e9773b6a9a185922 Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Mon, 29 Oct 2012 19:07:01 +0100
+Subject: [PATCH 082/204] swscale: support gray to 9bit and 10bit formats
+
+With the input of Kostya and Ronald.
+---
+ libswscale/swscale.c | 38 ++++++++++++++++++++++++++++++++++++--
+ libswscale/swscale_unscaled.c | 32 ++++++++++++++++++++++++++++++--
+ 2 files changed, 66 insertions(+), 4 deletions(-)
+
+diff --git a/libswscale/swscale.c b/libswscale/swscale.c
+index 3f54e4d..c1920de 100644
+--- a/libswscale/swscale.c
++++ b/libswscale/swscale.c
+@@ -61,6 +61,28 @@ static av_always_inline void fillPlane(uint8_t *plane, int stride, int width,
+ }
+ }
+
++static void fill_plane9or10(uint8_t *plane, int stride, int width,
++ int height, int y, uint8_t val,
++ const int dst_depth, const int big_endian)
++{
++ int i, j;
++ uint16_t *dst = (uint16_t *) (plane + stride * y);
++#define FILL8TO9_OR_10(wfunc) \
++ for (i = 0; i < height; i++) { \
++ for (j = 0; j < width; j++) { \
++ wfunc(&dst[j], (val << (dst_depth - 8)) | \
++ (val >> (16 - dst_depth))); \
++ } \
++ dst += stride / 2; \
++ }
++ if (big_endian) {
++ FILL8TO9_OR_10(AV_WB16);
++ } else {
++ FILL8TO9_OR_10(AV_WL16);
++ }
++}
++
++
+ static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW,
+ const uint8_t *_src, const int16_t *filter,
+ const int32_t *filterPos, int filterSize)
+@@ -658,8 +680,20 @@ static int swScale(SwsContext *c, const uint8_t *src[],
+ }
+ }
+
+- if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf)
+- fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, 255);
++ if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) {
++ int length = dstW;
++ int height = dstY - lastDstY;
++ if (is16BPS(c->dstFormat))
++ length *= 2;
++
++ if (is9_OR_10BPS(dstFormat)) {
++ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
++ fill_plane9or10(dst[3], dstStride[3], length, height, lastDstY,
++ 255, desc->comp[3].depth_minus1 + 1,
++ isBE(dstFormat));
++ } else
++ fillPlane(dst[3], dstStride[3], length, height, lastDstY, 255);
++ }
+
+ #if HAVE_MMXEXT_INLINE
+ if (av_get_cpu_flags() & AV_CPU_FLAG_MMXEXT)
+diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
+index 5efc647..9b919f8 100644
+--- a/libswscale/swscale_unscaled.c
++++ b/libswscale/swscale_unscaled.c
+@@ -98,6 +98,27 @@ static void fillPlane(uint8_t *plane, int stride, int width, int height, int y,
+ }
+ }
+
++static void fill_plane9or10(uint8_t *plane, int stride, int width,
++ int height, int y, uint8_t val,
++ const int dst_depth, const int big_endian)
++{
++ int i, j;
++ uint16_t *dst = (uint16_t *) (plane + stride * y);
++#define FILL8TO9_OR_10(wfunc) \
++ for (i = 0; i < height; i++) { \
++ for (j = 0; j < width; j++) { \
++ wfunc(&dst[j], (val << (dst_depth - 8)) | \
++ (val >> (16 - dst_depth))); \
++ } \
++ dst += stride / 2; \
++ }
++ if (big_endian) {
++ FILL8TO9_OR_10(AV_WB16);
++ } else {
++ FILL8TO9_OR_10(AV_WL16);
++ }
++}
++
+ static void copyPlane(const uint8_t *src, int srcStride,
+ int srcSliceY, int srcSliceH, int width,
+ uint8_t *dst, int dstStride)
+@@ -677,10 +698,17 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
+ // ignore palette for GRAY8
+ if (plane == 1 && !dst[2]) continue;
+ if (!src[plane] || (plane == 1 && !src[2])) {
++ int val = (plane == 3) ? 255 : 128;
+ if (is16BPS(c->dstFormat))
+ length *= 2;
+- fillPlane(dst[plane], dstStride[plane], length, height, y,
+- (plane == 3) ? 255 : 128);
++ if (is9_OR_10BPS(c->dstFormat)) {
++ fill_plane9or10(dst[plane], dstStride[plane],
++ length, height, y, val,
++ desc_dst->comp[plane].depth_minus1 + 1,
++ isBE(c->dstFormat));
++ } else
++ fillPlane(dst[plane], dstStride[plane], length, height, y,
++ val);
+ } else {
+ if (is9_OR_10BPS(c->srcFormat)) {
+ const int src_depth = desc_src->comp[plane].depth_minus1 + 1;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0083-pixfmt-support-more-yuva-formats.patch b/debian/patches/post-9beta2/0083-pixfmt-support-more-yuva-formats.patch
new file mode 100644
index 0000000..5895bb2
--- /dev/null
+++ b/debian/patches/post-9beta2/0083-pixfmt-support-more-yuva-formats.patch
@@ -0,0 +1,566 @@
+From 7658295ba353b8bedb3af904f46cfb1ba0cea86a Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Sun, 14 Oct 2012 08:06:27 +0200
+Subject: [PATCH 083/204] pixfmt: support more yuva formats
+
+Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
+---
+ libavcodec/raw.c | 19 ++++
+ libavformat/nut.c | 28 +++++
+ libavutil/pixdesc.c | 234 +++++++++++++++++++++++++++++++++++++++++
+ libavutil/pixfmt.h | 28 +++++
+ libswscale/utils.c | 18 ++++
+ tests/ref/lavfi/pixdesc | 18 ++++
+ tests/ref/lavfi/pixfmts_copy | 18 ++++
+ tests/ref/lavfi/pixfmts_null | 18 ++++
+ tests/ref/lavfi/pixfmts_scale | 18 ++++
+ tests/ref/lavfi/pixfmts_vflip | 18 ++++
+ 10 files changed, 417 insertions(+)
+
+diff --git a/libavcodec/raw.c b/libavcodec/raw.c
+index 6f0c923..4ccc6cc 100644
+--- a/libavcodec/raw.c
++++ b/libavcodec/raw.c
+@@ -124,6 +124,25 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
+ { AV_PIX_FMT_YUVA420P, MKTAG('Y', '4', 11 , 8 ) },
+ { AV_PIX_FMT_Y400A, MKTAG('Y', '2', 0 , 8 ) },
+
++ { AV_PIX_FMT_YUVA420P9LE, MKTAG('Y', '4', 11 , 9 ) },
++ { AV_PIX_FMT_YUVA420P9BE, MKTAG( 9 , 11 , '4', 'Y') },
++ { AV_PIX_FMT_YUVA422P9LE, MKTAG('Y', '4', 10 , 9 ) },
++ { AV_PIX_FMT_YUVA422P9BE, MKTAG( 9 , 10 , '4', 'Y') },
++ { AV_PIX_FMT_YUVA444P9LE, MKTAG('Y', '4', 0 , 9 ) },
++ { AV_PIX_FMT_YUVA444P9BE, MKTAG( 9 , 0 , '4', 'Y') },
++ { AV_PIX_FMT_YUVA420P10LE, MKTAG('Y', '4', 11 , 10 ) },
++ { AV_PIX_FMT_YUVA420P10BE, MKTAG(10 , 11 , '4', 'Y') },
++ { AV_PIX_FMT_YUVA422P10LE, MKTAG('Y', '4', 10 , 10 ) },
++ { AV_PIX_FMT_YUVA422P10BE, MKTAG(10 , 10 , '4', 'Y') },
++ { AV_PIX_FMT_YUVA444P10LE, MKTAG('Y', '4', 0 , 10 ) },
++ { AV_PIX_FMT_YUVA444P10BE, MKTAG(10 , 0 , '4', 'Y') },
++ { AV_PIX_FMT_YUVA420P16LE, MKTAG('Y', '4', 11 , 16 ) },
++ { AV_PIX_FMT_YUVA420P16BE, MKTAG(16 , 11 , '4', 'Y') },
++ { AV_PIX_FMT_YUVA422P16LE, MKTAG('Y', '4', 10 , 16 ) },
++ { AV_PIX_FMT_YUVA422P16BE, MKTAG(16 , 10 , '4', 'Y') },
++ { AV_PIX_FMT_YUVA444P16LE, MKTAG('Y', '4', 0 , 16 ) },
++ { AV_PIX_FMT_YUVA444P16BE, MKTAG(16 , 0 , '4', 'Y') },
++
+ /* quicktime */
+ { AV_PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
+ { AV_PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', 'y') },
+diff --git a/libavformat/nut.c b/libavformat/nut.c
+index 85b126b..65fadbf 100644
+--- a/libavformat/nut.c
++++ b/libavformat/nut.c
+@@ -92,6 +92,34 @@ const AVCodecTag ff_nut_video_tags[] = {
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 0 , '3', 'Y') },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11 , 8 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '2', 0 , 8 ) },
++
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0 , 9 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 0 , '1', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11 , 9 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 11 , '4', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10 , 9 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 10 , '4', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0 , 9 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 0 , '4', 'Y') },
++
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0 , 10 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 0 , '1', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11 , 10 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 11 , '4', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10 , 10 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 10 , '4', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0 , 10 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 0 , '4', 'Y') },
++
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0 , 16 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 0 , '1', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11 , 16 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 11 , '4', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10 , 16 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 10 , '4', 'Y') },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0 , 16 ) },
++ { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 0 , '4', 'Y') },
++
+ { AV_CODEC_ID_NONE , 0 }
+ };
+
+diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
+index b8cfabd..bc446b1 100644
+--- a/libavutil/pixdesc.c
++++ b/libavutil/pixdesc.c
+@@ -558,6 +558,240 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
+ },
+ .flags = PIX_FMT_PLANAR,
+ },
++ [AV_PIX_FMT_YUVA420P9BE] = {
++ .name = "yuva420p9be",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 1,
++ .comp = {
++ { 0, 1, 1, 0, 8 }, /* Y */
++ { 1, 1, 1, 0, 8 }, /* U */
++ { 2, 1, 1, 0, 8 }, /* V */
++ { 3, 1, 1, 0, 8 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA420P9LE] = {
++ .name = "yuva420p9le",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 1,
++ .comp = {
++ { 0, 1, 1, 0, 8 }, /* Y */
++ { 1, 1, 1, 0, 8 }, /* U */
++ { 2, 1, 1, 0, 8 }, /* V */
++ { 3, 1, 1, 0, 8 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA422P9BE] = {
++ .name = "yuva422p9be",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 8 }, /* Y */
++ { 1, 1, 1, 0, 8 }, /* U */
++ { 2, 1, 1, 0, 8 }, /* V */
++ { 3, 1, 1, 0, 8 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA422P9LE] = {
++ .name = "yuva422p9le",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 8 }, /* Y */
++ { 1, 1, 1, 0, 8 }, /* U */
++ { 2, 1, 1, 0, 8 }, /* V */
++ { 3, 1, 1, 0, 8 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA444P9BE] = {
++ .name = "yuva444p9be",
++ .nb_components = 4,
++ .log2_chroma_w = 0,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 8 }, /* Y */
++ { 1, 1, 1, 0, 8 }, /* U */
++ { 2, 1, 1, 0, 8 }, /* V */
++ { 3, 1, 1, 0, 8 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA444P9LE] = {
++ .name = "yuva444p9le",
++ .nb_components = 4,
++ .log2_chroma_w = 0,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 8 }, /* Y */
++ { 1, 1, 1, 0, 8 }, /* U */
++ { 2, 1, 1, 0, 8 }, /* V */
++ { 3, 1, 1, 0, 8 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA420P10BE] = {
++ .name = "yuva420p10be",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 1,
++ .comp = {
++ { 0, 1, 1, 0, 9 }, /* Y */
++ { 1, 1, 1, 0, 9 }, /* U */
++ { 2, 1, 1, 0, 9 }, /* V */
++ { 3, 1, 1, 0, 9 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA420P10LE] = {
++ .name = "yuva420p10le",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 1,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA422P10BE] = {
++ .name = "yuva422p10be",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA422P10LE] = {
++ .name = "yuva422p10le",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA444P10BE] = {
++ .name = "yuva444p10be",
++ .nb_components = 4,
++ .log2_chroma_w = 0,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA444P10LE] = {
++ .name = "yuva444p10le",
++ .nb_components = 4,
++ .log2_chroma_w = 0,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA420P16BE] = {
++ .name = "yuva420p16be",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 1,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA420P16LE] = {
++ .name = "yuva420p16le",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 1,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA422P16BE] = {
++ .name = "yuva422p16be",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA422P16LE] = {
++ .name = "yuva422p16le",
++ .nb_components = 4,
++ .log2_chroma_w = 1,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA444P16BE] = {
++ .name = "yuva444p16be",
++ .nb_components = 4,
++ .log2_chroma_w = 0,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
++ },
++ [AV_PIX_FMT_YUVA444P16LE] = {
++ .name = "yuva444p16le",
++ .nb_components = 4,
++ .log2_chroma_w = 0,
++ .log2_chroma_h = 0,
++ .comp = {
++ { 0, 1, 1, 0, 15 }, /* Y */
++ { 1, 1, 1, 0, 15 }, /* U */
++ { 2, 1, 1, 0, 15 }, /* V */
++ { 3, 1, 1, 0, 15 }, /* A */
++ },
++ .flags = PIX_FMT_PLANAR,
++ },
+ [AV_PIX_FMT_VDPAU_H264] = {
+ .name = "vdpau_h264",
+ .log2_chroma_w = 1,
+diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
+index b11a034..8e454a8 100644
+--- a/libavutil/pixfmt.h
++++ b/libavutil/pixfmt.h
+@@ -160,6 +160,24 @@ enum AVPixelFormat {
+ AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
+ AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+ AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
++ AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big endian
++ AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little endian
++ AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big endian
++ AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little endian
++ AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big endian
++ AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little endian
++ AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big endian)
++ AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little endian)
++ AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big endian)
++ AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little endian)
++ AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big endian)
++ AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little endian)
++ AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big endian)
++ AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little endian)
++ AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big endian)
++ AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little endian)
++ AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big endian)
++ AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little endian)
+ AV_PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+ #if FF_API_PIX_FMT
+@@ -202,6 +220,16 @@ enum AVPixelFormat {
+ #define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE)
+ #define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE)
+
++#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
++#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
++#define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
++#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
++#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
++#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
++#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
++#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
++#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
++
+ #if FF_API_PIX_FMT
+ #define PixelFormat AVPixelFormat
+
+diff --git a/libswscale/utils.c b/libswscale/utils.c
+index a40dfe7..f68f120 100644
+--- a/libswscale/utils.c
++++ b/libswscale/utils.c
+@@ -110,6 +110,24 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
+ [AV_PIX_FMT_YUVA420P] = { 1, 1 },
+ [AV_PIX_FMT_YUVA422P] = { 1, 1 },
+ [AV_PIX_FMT_YUVA444P] = { 1, 1 },
++ [AV_PIX_FMT_YUVA420P9BE] = { 1, 1 },
++ [AV_PIX_FMT_YUVA420P9LE] = { 1, 1 },
++ [AV_PIX_FMT_YUVA422P9BE] = { 1, 1 },
++ [AV_PIX_FMT_YUVA422P9LE] = { 1, 1 },
++ [AV_PIX_FMT_YUVA444P9BE] = { 1, 1 },
++ [AV_PIX_FMT_YUVA444P9LE] = { 1, 1 },
++ [AV_PIX_FMT_YUVA420P10BE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA420P10LE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA422P10BE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA422P10LE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA444P10BE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA444P10LE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA420P16BE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA420P16LE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA422P16BE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA422P16LE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA444P16BE]= { 1, 1 },
++ [AV_PIX_FMT_YUVA444P16LE]= { 1, 1 },
+ [AV_PIX_FMT_RGB48BE] = { 1, 1 },
+ [AV_PIX_FMT_RGB48LE] = { 1, 1 },
+ [AV_PIX_FMT_RGB565BE] = { 1, 1 },
+diff --git a/tests/ref/lavfi/pixdesc b/tests/ref/lavfi/pixdesc
+index dc1b857..5716cf1 100644
+--- a/tests/ref/lavfi/pixdesc
++++ b/tests/ref/lavfi/pixdesc
+@@ -57,8 +57,26 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4
+ yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054
+ yuv444p9le f0606604a5c08becab6ba500124c4b7c
+ yuva420p a29884f3f3dfe1e00b961bc17bef3d47
++yuva420p10be 145366ff1632de3e300d947f49844284
++yuva420p10le 242b310218a41aacc59f78f42f949d60
++yuva420p16be 25a335f66a0670911ced818aa42fb670
++yuva420p16le 97bf252e6c030f0f0412d3826c2ea259
++yuva420p9be 06b764d85bd3c22e9b7ca4babed84d4f
++yuva420p9le 1f01cdd4fc46f98d4c11b2947307a0e3
+ yuva422p 92b6815f465297284cdb843711682cee
++yuva422p10be c8722cb6e86d478f501d514a2d004867
++yuva422p10le 5c2767a47c94966052955bc48f72dd94
++yuva422p16be ef442b11b26e5e61f3c958fa309576dd
++yuva422p16le 5789009759d7a44dacc6da2194e402b1
++yuva422p9be e0d2f45f7f5541eee988137c7ebb3495
++yuva422p9le a4ec81f328efd3856dec430fb27f2f56
+ yuva444p c523716e4900cfe515eaab1d7124fdd9
++yuva444p10be 03df7c3936c25626ea596c28e0466129
++yuva444p10le 55398bb467bc7957288d59af9f0bfadd
++yuva444p16be ee7b9dd854e36b165d5b7cffb646ba6c
++yuva444p16le ec93b2907923d5655e9fb085479260ef
++yuva444p9be 03414257d78e72c28d03e3c247319b7c
++yuva444p9le e421d753257e36a79c2c0ec1607ac9e6
+ yuvj420p 32eec78ba51857b16ce9b813a49b7189
+ yuvj422p 0dfa0ed434f73be51428758c69e082cb
+ yuvj440p 657501a28004e27a592757a7509f5189
+diff --git a/tests/ref/lavfi/pixfmts_copy b/tests/ref/lavfi/pixfmts_copy
+index dc1b857..5716cf1 100644
+--- a/tests/ref/lavfi/pixfmts_copy
++++ b/tests/ref/lavfi/pixfmts_copy
+@@ -57,8 +57,26 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4
+ yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054
+ yuv444p9le f0606604a5c08becab6ba500124c4b7c
+ yuva420p a29884f3f3dfe1e00b961bc17bef3d47
++yuva420p10be 145366ff1632de3e300d947f49844284
++yuva420p10le 242b310218a41aacc59f78f42f949d60
++yuva420p16be 25a335f66a0670911ced818aa42fb670
++yuva420p16le 97bf252e6c030f0f0412d3826c2ea259
++yuva420p9be 06b764d85bd3c22e9b7ca4babed84d4f
++yuva420p9le 1f01cdd4fc46f98d4c11b2947307a0e3
+ yuva422p 92b6815f465297284cdb843711682cee
++yuva422p10be c8722cb6e86d478f501d514a2d004867
++yuva422p10le 5c2767a47c94966052955bc48f72dd94
++yuva422p16be ef442b11b26e5e61f3c958fa309576dd
++yuva422p16le 5789009759d7a44dacc6da2194e402b1
++yuva422p9be e0d2f45f7f5541eee988137c7ebb3495
++yuva422p9le a4ec81f328efd3856dec430fb27f2f56
+ yuva444p c523716e4900cfe515eaab1d7124fdd9
++yuva444p10be 03df7c3936c25626ea596c28e0466129
++yuva444p10le 55398bb467bc7957288d59af9f0bfadd
++yuva444p16be ee7b9dd854e36b165d5b7cffb646ba6c
++yuva444p16le ec93b2907923d5655e9fb085479260ef
++yuva444p9be 03414257d78e72c28d03e3c247319b7c
++yuva444p9le e421d753257e36a79c2c0ec1607ac9e6
+ yuvj420p 32eec78ba51857b16ce9b813a49b7189
+ yuvj422p 0dfa0ed434f73be51428758c69e082cb
+ yuvj440p 657501a28004e27a592757a7509f5189
+diff --git a/tests/ref/lavfi/pixfmts_null b/tests/ref/lavfi/pixfmts_null
+index dc1b857..5716cf1 100644
+--- a/tests/ref/lavfi/pixfmts_null
++++ b/tests/ref/lavfi/pixfmts_null
+@@ -57,8 +57,26 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4
+ yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054
+ yuv444p9le f0606604a5c08becab6ba500124c4b7c
+ yuva420p a29884f3f3dfe1e00b961bc17bef3d47
++yuva420p10be 145366ff1632de3e300d947f49844284
++yuva420p10le 242b310218a41aacc59f78f42f949d60
++yuva420p16be 25a335f66a0670911ced818aa42fb670
++yuva420p16le 97bf252e6c030f0f0412d3826c2ea259
++yuva420p9be 06b764d85bd3c22e9b7ca4babed84d4f
++yuva420p9le 1f01cdd4fc46f98d4c11b2947307a0e3
+ yuva422p 92b6815f465297284cdb843711682cee
++yuva422p10be c8722cb6e86d478f501d514a2d004867
++yuva422p10le 5c2767a47c94966052955bc48f72dd94
++yuva422p16be ef442b11b26e5e61f3c958fa309576dd
++yuva422p16le 5789009759d7a44dacc6da2194e402b1
++yuva422p9be e0d2f45f7f5541eee988137c7ebb3495
++yuva422p9le a4ec81f328efd3856dec430fb27f2f56
+ yuva444p c523716e4900cfe515eaab1d7124fdd9
++yuva444p10be 03df7c3936c25626ea596c28e0466129
++yuva444p10le 55398bb467bc7957288d59af9f0bfadd
++yuva444p16be ee7b9dd854e36b165d5b7cffb646ba6c
++yuva444p16le ec93b2907923d5655e9fb085479260ef
++yuva444p9be 03414257d78e72c28d03e3c247319b7c
++yuva444p9le e421d753257e36a79c2c0ec1607ac9e6
+ yuvj420p 32eec78ba51857b16ce9b813a49b7189
+ yuvj422p 0dfa0ed434f73be51428758c69e082cb
+ yuvj440p 657501a28004e27a592757a7509f5189
+diff --git a/tests/ref/lavfi/pixfmts_scale b/tests/ref/lavfi/pixfmts_scale
+index acd40e3..d8ae09c 100644
+--- a/tests/ref/lavfi/pixfmts_scale
++++ b/tests/ref/lavfi/pixfmts_scale
+@@ -57,8 +57,26 @@ yuv444p16le a0c5d3c7bf3f181db503cf8e450d1335
+ yuv444p9be 9ac2643ce7f7e5c4e17c8c9fd8494d4a
+ yuv444p9le 896a1cc9cccca1ba410dd53942d33cc4
+ yuva420p 8673a9131fb47de69788863f93a50eb7
++yuva420p10be cf397b35db9407496093b2ad64f3106c
++yuva420p10le 8a06c377b8aa2b2979054e074582a5b5
++yuva420p16be a61d8ddb646e2d26020fc7ed2a48c1a9
++yuva420p16le 90ef774f86ad3177ec57eca8744b4e09
++yuva420p9be b43d5d88a474c80abad8e887eb5a3317
++yuva420p9le ada2b719827059d70ebc57e2a3f9da92
+ yuva422p 3c76ebeca0a7d3aa5f8e31ef80a86ffe
++yuva422p10be c12a427d2b8fc84f93fd3cf9fd5bcb14
++yuva422p10le aefcda062e7e3463c887faa9d926aca7
++yuva422p16be a31bd04c58c22690f2a7c745f34cf48f
++yuva422p16le 0bc3720dba6076dcce3b74b1d3c6c4b7
++yuva422p9be b21d2aa97ff643c86bbc08b578729c39
++yuva422p9le c3eda8831e9b9c94a3eb487d33114103
+ yuva444p 3268c6abe5e3cdbd16552a1eddced816
++yuva444p10be 4f6eaf2bbe8a083773b9f061fec20e41
++yuva444p10le 2eeda83856df77760cd30e477e8ba00b
++yuva444p16be 3587f05da58a8435aad648506562d39b
++yuva444p16le 3a3df23feb60d8832b566fd9765983d0
++yuva444p9be d5342be0074975ea65907f5b65c7a335
++yuva444p9le c41849b0134670d6f6253c337defbb04
+ yuvj420p 30427bd6caf5bda93a173dbebe759e09
+ yuvj422p fc8288f64fd149573f73cf8da05d8e6d
+ yuvj440p 508ac7a9ddeb6d1794a1100ba7a1664c
+diff --git a/tests/ref/lavfi/pixfmts_vflip b/tests/ref/lavfi/pixfmts_vflip
+index a4dffb9..d820518 100644
+--- a/tests/ref/lavfi/pixfmts_vflip
++++ b/tests/ref/lavfi/pixfmts_vflip
+@@ -57,8 +57,26 @@ yuv444p16le 8e83323cf102d6c823a03ae8a7b7e033
+ yuv444p9be 6ac92b7dc9ab2fc59bee99204886899a
+ yuv444p9le 85aef13a654953d3455d89770b0d74bd
+ yuva420p c705d1cf061d8c6580ac690b55f92276
++yuva420p10be baa5e3b0ff6d0ebbb0958560cd763c6e
++yuva420p10le 32473853156341586ed716090427fc10
++yuva420p16be bf3b134eb70878df9afba61d03e930b8
++yuva420p16le 105d375154329a381aa58379a0a6ec46
++yuva420p9be 8273d591e055f48990c29dd905a6cdfd
++yuva420p9le 95ced0bb07e422d98db61a35cdb3fb8f
+ yuva422p 6aed0ea657ed51cc047a4fbdd981aec8
++yuva422p10be b76d8be9b4035d3164c35a2fdb020636
++yuva422p10le 09aa2454075f999dbd3175b5c435dacf
++yuva422p16be 39552c259ca242f2417e913ffc602fde
++yuva422p16le 16faa558a34291ca32f6d94dce211ee2
++yuva422p9be a951eafb62c092c63f7566b6803f60df
++yuva422p9le 00b39cfca78666e057ee527f5e174a04
+ yuva444p da5d64f2b2bd2013c186456f595fad65
++yuva444p10be 09375aa0c3a60436fc65ca0da76ca542
++yuva444p10le a4baf701134c7ff33f806ad00501d8f5
++yuva444p16be 7e9b799b057e1446dabbf0f738480cfb
++yuva444p16le 556d58b91a617fe4a83af99a4aea1c2e
++yuva444p9be b5a31de4fac408eeecaf3aff11f40e55
++yuva444p9le 67467f1e1d9edbd59d3984ebbfe24be6
+ yuvj420p 41fd02b204da0ab62452cd14b595e2e4
+ yuvj422p 7f6ca9bc1812cde02036d7d29a7cce43
+ yuvj440p 25711c3c0fd15ec19c59a10784fcfb96
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0084-configure-fix-print_config-with-broke-awks.patch b/debian/patches/post-9beta2/0084-configure-fix-print_config-with-broke-awks.patch
new file mode 100644
index 0000000..5728879
--- /dev/null
+++ b/debian/patches/post-9beta2/0084-configure-fix-print_config-with-broke-awks.patch
@@ -0,0 +1,30 @@
+From d16c4aebba1ba611e10d86aa02be4cdfd3fbc3c5 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Tue, 30 Oct 2012 11:57:30 +0000
+Subject: [PATCH 084/204] configure: fix print_config() with broke awks
+
+Some awk versions do not treat the result of unary + on a (numeric)
+string as numeric, giving wrong results when used in a boolean context
+Using unary - instead is logically equivalent works as expected.
+
+Signed-off-by: Mans Rullgard <mans at mansr.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index f215c76..9528b5d 100755
+--- a/configure
++++ b/configure
+@@ -584,7 +584,7 @@ print_config(){
+ } else if (file ~ /\\.asm\$/) {
+ printf(\"%%define %s %d\\n\", c, v) >>file;
+ } else if (file ~ /\\.mak\$/) {
+- n = +v ? \"\" : \"!\";
++ n = -v ? \"\" : \"!\";
+ printf(\"%s%s=yes\\n\", n, c) >>file;
+ }
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0085-cngdec-Update-the-LPC-coefficients-after-averaging-t.patch b/debian/patches/post-9beta2/0085-cngdec-Update-the-LPC-coefficients-after-averaging-t.patch
new file mode 100644
index 0000000..f7522d2
--- /dev/null
+++ b/debian/patches/post-9beta2/0085-cngdec-Update-the-LPC-coefficients-after-averaging-t.patch
@@ -0,0 +1,37 @@
+From 9b50d20cd24c0a91bace9d651e2d0fd1e91db3c9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 30 Oct 2012 12:26:39 +0200
+Subject: [PATCH 085/204] cngdec: Update the LPC coefficients after averaging
+ the reflection coefficients
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+I somehow messed up the placement of this one.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavcodec/cngdec.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c
+index c22fd55..8cfe9cf 100644
+--- a/libavcodec/cngdec.c
++++ b/libavcodec/cngdec.c
+@@ -112,12 +112,12 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
+ for (i = 0; i < FFMIN(avpkt->size - 1, p->order); i++) {
+ p->target_refl_coef[i] = (avpkt->data[1 + i] - 127) / 128.0;
+ }
+- make_lpc_coefs(p->lpc_coef, p->refl_coef, p->order);
+ }
+
+ p->energy = p->energy / 2 + p->target_energy / 2;
+ for (i = 0; i < p->order; i++)
+ p->refl_coef[i] = 0.6 *p->refl_coef[i] + 0.4 * p->target_refl_coef[i];
++ make_lpc_coefs(p->lpc_coef, p->refl_coef, p->order);
+
+ for (i = 0; i < p->order; i++)
+ e *= 1.0 - p->refl_coef[i]*p->refl_coef[i];
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0086-cngdec-Fix-the-memset-size-to-cover-the-full-array.patch b/debian/patches/post-9beta2/0086-cngdec-Fix-the-memset-size-to-cover-the-full-array.patch
new file mode 100644
index 0000000..a073755
--- /dev/null
+++ b/debian/patches/post-9beta2/0086-cngdec-Fix-the-memset-size-to-cover-the-full-array.patch
@@ -0,0 +1,32 @@
+From cafefd889b9e9f36814dc4ca13ed169f667b41a4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 30 Oct 2012 12:17:35 +0200
+Subject: [PATCH 086/204] cngdec: Fix the memset size to cover the full array
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This was a leftover from previous iterations of the code, where the
+refl coef arrays were statically allocated.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavcodec/cngdec.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c
+index 8cfe9cf..c05bfd9 100644
+--- a/libavcodec/cngdec.c
++++ b/libavcodec/cngdec.c
+@@ -108,7 +108,7 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
+ if (avpkt->size) {
+ float dbov = -avpkt->data[0] / 10.0;
+ p->target_energy = 1081109975 * pow(10, dbov) * 0.75;
+- memset(p->target_refl_coef, 0, sizeof(p->refl_coef));
++ memset(p->target_refl_coef, 0, p->order * sizeof(*p->target_refl_coef));
+ for (i = 0; i < FFMIN(avpkt->size - 1, p->order); i++) {
+ p->target_refl_coef[i] = (avpkt->data[1 + i] - 127) / 128.0;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0087-cngdec-Make-the-dbov-variable-have-the-right-unit.patch b/debian/patches/post-9beta2/0087-cngdec-Make-the-dbov-variable-have-the-right-unit.patch
new file mode 100644
index 0000000..9f15618
--- /dev/null
+++ b/debian/patches/post-9beta2/0087-cngdec-Make-the-dbov-variable-have-the-right-unit.patch
@@ -0,0 +1,33 @@
+From 036e6c37d31e471447f71decaea55996bde3d9a2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 30 Oct 2012 11:56:54 +0200
+Subject: [PATCH 087/204] cngdec: Make the dbov variable have the right unit
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Previously the unit of the variable was Bov, not dBov.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavcodec/cngdec.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c
+index c05bfd9..fca4b9e 100644
+--- a/libavcodec/cngdec.c
++++ b/libavcodec/cngdec.c
+@@ -106,8 +106,8 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
+ float scaling;
+
+ if (avpkt->size) {
+- float dbov = -avpkt->data[0] / 10.0;
+- p->target_energy = 1081109975 * pow(10, dbov) * 0.75;
++ int dbov = -avpkt->data[0];
++ p->target_energy = 1081109975 * pow(10, dbov / 10.0) * 0.75;
+ memset(p->target_refl_coef, 0, p->order * sizeof(*p->target_refl_coef));
+ for (i = 0; i < FFMIN(avpkt->size - 1, p->order); i++) {
+ p->target_refl_coef[i] = (avpkt->data[1 + i] - 127) / 128.0;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0088-cngdec-Allow-flushing-the-decoder.patch b/debian/patches/post-9beta2/0088-cngdec-Allow-flushing-the-decoder.patch
new file mode 100644
index 0000000..43a4eb8
--- /dev/null
+++ b/debian/patches/post-9beta2/0088-cngdec-Allow-flushing-the-decoder.patch
@@ -0,0 +1,74 @@
+From 6b68223d315aa4daf2e9006f6f37418ca5766698 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 30 Oct 2012 12:03:25 +0200
+Subject: [PATCH 088/204] cngdec: Allow flushing the decoder
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+After a flush, don't average the output envelope and energy with
+previous iterations.
+
+Also start directly from the target values for the first iteration
+at startup.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavcodec/cngdec.c | 20 +++++++++++++++++---
+ 1 file changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c
+index fca4b9e..4fe7839 100644
+--- a/libavcodec/cngdec.c
++++ b/libavcodec/cngdec.c
+@@ -32,6 +32,7 @@ typedef struct CNGContext {
+ float *lpc_coef;
+ int order;
+ int energy, target_energy;
++ int inited;
+ float *filter_out;
+ float *excitation;
+ AVLFG lfg;
+@@ -94,6 +95,12 @@ static void make_lpc_coefs(float *lpc, const float *refl, int order)
+ memcpy(lpc, cur, sizeof(*lpc) * order);
+ }
+
++static void cng_decode_flush(AVCodecContext *avctx)
++{
++ CNGContext *p = avctx->priv_data;
++ p->inited = 0;
++}
++
+ static int cng_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+ {
+@@ -114,9 +121,15 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
+ }
+ }
+
+- p->energy = p->energy / 2 + p->target_energy / 2;
+- for (i = 0; i < p->order; i++)
+- p->refl_coef[i] = 0.6 *p->refl_coef[i] + 0.4 * p->target_refl_coef[i];
++ if (p->inited) {
++ p->energy = p->energy / 2 + p->target_energy / 2;
++ for (i = 0; i < p->order; i++)
++ p->refl_coef[i] = 0.6 *p->refl_coef[i] + 0.4 * p->target_refl_coef[i];
++ } else {
++ p->energy = p->target_energy;
++ memcpy(p->refl_coef, p->target_refl_coef, p->order * sizeof(*p->refl_coef));
++ p->inited = 1;
++ }
+ make_lpc_coefs(p->lpc_coef, p->refl_coef, p->order);
+
+ for (i = 0; i < p->order; i++)
+@@ -154,6 +167,7 @@ AVCodec ff_comfortnoise_decoder = {
+ .priv_data_size = sizeof(CNGContext),
+ .init = cng_decode_init,
+ .decode = cng_decode_frame,
++ .flush = cng_decode_flush,
+ .close = cng_decode_close,
+ .long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
+ .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0089-cng-Reindent-some-incorrectly-indented-lines.patch b/debian/patches/post-9beta2/0089-cng-Reindent-some-incorrectly-indented-lines.patch
new file mode 100644
index 0000000..dd49a8e
--- /dev/null
+++ b/debian/patches/post-9beta2/0089-cng-Reindent-some-incorrectly-indented-lines.patch
@@ -0,0 +1,43 @@
+From ab9545a290d1f48eb4c361ecd0b5df0a966a9a79 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 30 Oct 2012 12:09:57 +0200
+Subject: [PATCH 089/204] cng: Reindent some incorrectly indented lines
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavcodec/cngdec.c | 2 +-
+ libavcodec/cngenc.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c
+index 4fe7839..caaa9c1 100644
+--- a/libavcodec/cngdec.c
++++ b/libavcodec/cngdec.c
+@@ -102,7 +102,7 @@ static void cng_decode_flush(AVCodecContext *avctx)
+ }
+
+ static int cng_decode_frame(AVCodecContext *avctx, void *data,
+- int *got_frame_ptr, AVPacket *avpkt)
++ int *got_frame_ptr, AVPacket *avpkt)
+ {
+
+ CNGContext *p = avctx->priv_data;
+diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c
+index 1e3f8f0..a553a3f 100644
+--- a/libavcodec/cngenc.c
++++ b/libavcodec/cngenc.c
+@@ -67,7 +67,7 @@ static av_cold int cng_encode_init(AVCodecContext *avctx)
+ }
+
+ static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+- const AVFrame *frame, int *got_packet_ptr)
++ const AVFrame *frame, int *got_packet_ptr)
+ {
+ CNGContext *p = avctx->priv_data;
+ int ret, i;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0090-x86-include-x86inc.asm-in-x86util.asm.patch b/debian/patches/post-9beta2/0090-x86-include-x86inc.asm-in-x86util.asm.patch
new file mode 100644
index 0000000..7aca464
--- /dev/null
+++ b/debian/patches/post-9beta2/0090-x86-include-x86inc.asm-in-x86util.asm.patch
@@ -0,0 +1,497 @@
+From 6860b4081d046558c44b1b42f22022ea341a2a73 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 8 Jul 2012 01:20:48 +0200
+Subject: [PATCH 090/204] x86: include x86inc.asm in x86util.asm
+
+This is necessary to allow refactoring some x86util macros with cpuflags.
+---
+ libavcodec/x86/ac3dsp.asm | 1 -
+ libavcodec/x86/dct32.asm | 1 -
+ libavcodec/x86/deinterlace.asm | 1 -
+ libavcodec/x86/dsputil.asm | 1 -
+ libavcodec/x86/dsputilenc.asm | 1 -
+ libavcodec/x86/fft.asm | 1 -
+ libavcodec/x86/fmtconvert.asm | 1 -
+ libavcodec/x86/h264_chromamc.asm | 1 -
+ libavcodec/x86/h264_chromamc_10bit.asm | 1 -
+ libavcodec/x86/h264_deblock.asm | 1 -
+ libavcodec/x86/h264_deblock_10bit.asm | 1 -
+ libavcodec/x86/h264_idct.asm | 1 -
+ libavcodec/x86/h264_idct_10bit.asm | 1 -
+ libavcodec/x86/h264_intrapred.asm | 1 -
+ libavcodec/x86/h264_intrapred_10bit.asm | 1 -
+ libavcodec/x86/h264_qpel_10bit.asm | 1 -
+ libavcodec/x86/h264_weight.asm | 2 +-
+ libavcodec/x86/h264_weight_10bit.asm | 1 -
+ libavcodec/x86/imdct36.asm | 1 -
+ libavcodec/x86/pngdsp.asm | 1 -
+ libavcodec/x86/proresdsp.asm | 1 -
+ libavcodec/x86/rv34dsp.asm | 1 -
+ libavcodec/x86/rv40dsp.asm | 1 -
+ libavcodec/x86/sbrdsp.asm | 1 -
+ libavcodec/x86/vc1dsp.asm | 1 -
+ libavcodec/x86/vp3dsp.asm | 1 -
+ libavcodec/x86/vp56dsp.asm | 1 -
+ libavcodec/x86/vp8dsp.asm | 1 -
+ libavfilter/x86/hqdn3d.asm | 2 +-
+ libavresample/x86/audio_convert.asm | 1 -
+ libavresample/x86/audio_mix.asm | 1 -
+ libavutil/x86/cpuid.asm | 2 +-
+ libavutil/x86/float_dsp.asm | 1 -
+ libavutil/x86/x86util.asm | 2 ++
+ libswscale/x86/input.asm | 1 -
+ libswscale/x86/output.asm | 1 -
+ libswscale/x86/scale.asm | 1 -
+ 37 files changed, 5 insertions(+), 36 deletions(-)
+
+diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
+index 176fd3d..01c1b8e 100644
+--- a/libavcodec/x86/ac3dsp.asm
++++ b/libavcodec/x86/ac3dsp.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/dct32.asm b/libavcodec/x86/dct32.asm
+index 58ee8d3..53c2415 100644
+--- a/libavcodec/x86/dct32.asm
++++ b/libavcodec/x86/dct32.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA 32
+diff --git a/libavcodec/x86/deinterlace.asm b/libavcodec/x86/deinterlace.asm
+index 8681181..f15b8ea 100644
+--- a/libavcodec/x86/deinterlace.asm
++++ b/libavcodec/x86/deinterlace.asm
+@@ -20,7 +20,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/dsputil.asm b/libavcodec/x86/dsputil.asm
+index fcb1b6d..4b36ca8 100644
+--- a/libavcodec/x86/dsputil.asm
++++ b/libavcodec/x86/dsputil.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm
+index b7078f1..39031cb 100644
+--- a/libavcodec/x86/dsputilenc.asm
++++ b/libavcodec/x86/dsputilenc.asm
+@@ -21,7 +21,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;*****************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION .text
+diff --git a/libavcodec/x86/fft.asm b/libavcodec/x86/fft.asm
+index f054298..465c08b 100644
+--- a/libavcodec/x86/fft.asm
++++ b/libavcodec/x86/fft.asm
+@@ -28,7 +28,6 @@
+ ; in blocks as conventient to the vector size.
+ ; i.e. {4x real, 4x imaginary, 4x real, ...} (or 2x respectively)
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ %if ARCH_X86_64
+diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm
+index 46b7e85..d59c43b 100644
+--- a/libavcodec/x86/fmtconvert.asm
++++ b/libavcodec/x86/fmtconvert.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_TEXT
+diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm
+index 56b8e56..4651883 100644
+--- a/libavcodec/x86/h264_chromamc.asm
++++ b/libavcodec/x86/h264_chromamc.asm
+@@ -20,7 +20,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/h264_chromamc_10bit.asm b/libavcodec/x86/h264_chromamc_10bit.asm
+index bcdb27c..254c69f 100644
+--- a/libavcodec/x86/h264_chromamc_10bit.asm
++++ b/libavcodec/x86/h264_chromamc_10bit.asm
+@@ -22,7 +22,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
+index 940a8f7..103fb0d 100644
+--- a/libavcodec/x86/h264_deblock.asm
++++ b/libavcodec/x86/h264_deblock.asm
+@@ -24,7 +24,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/h264_deblock_10bit.asm b/libavcodec/x86/h264_deblock_10bit.asm
+index 7b9316d..e718613 100644
+--- a/libavcodec/x86/h264_deblock_10bit.asm
++++ b/libavcodec/x86/h264_deblock_10bit.asm
+@@ -24,7 +24,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm
+index 68864a4..5ae3263 100644
+--- a/libavcodec/x86/h264_idct.asm
++++ b/libavcodec/x86/h264_idct.asm
+@@ -26,7 +26,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;*****************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/h264_idct_10bit.asm b/libavcodec/x86/h264_idct_10bit.asm
+index 6afcee2..ad923f9 100644
+--- a/libavcodec/x86/h264_idct_10bit.asm
++++ b/libavcodec/x86/h264_idct_10bit.asm
+@@ -22,7 +22,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
+index 7c6aa12..3a5a6d4 100644
+--- a/libavcodec/x86/h264_intrapred.asm
++++ b/libavcodec/x86/h264_intrapred.asm
+@@ -22,7 +22,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/h264_intrapred_10bit.asm b/libavcodec/x86/h264_intrapred_10bit.asm
+index c3f6dc4..98c9118 100644
+--- a/libavcodec/x86/h264_intrapred_10bit.asm
++++ b/libavcodec/x86/h264_intrapred_10bit.asm
+@@ -22,7 +22,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/h264_qpel_10bit.asm b/libavcodec/x86/h264_qpel_10bit.asm
+index f380cfc..0a9c433 100644
+--- a/libavcodec/x86/h264_qpel_10bit.asm
++++ b/libavcodec/x86/h264_qpel_10bit.asm
+@@ -22,7 +22,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA 32
+diff --git a/libavcodec/x86/h264_weight.asm b/libavcodec/x86/h264_weight.asm
+index c8779cc..6fe9a40 100644
+--- a/libavcodec/x86/h264_weight.asm
++++ b/libavcodec/x86/h264_weight.asm
+@@ -21,7 +21,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
++%include "x86util.asm"
+
+ SECTION .text
+
+diff --git a/libavcodec/x86/h264_weight_10bit.asm b/libavcodec/x86/h264_weight_10bit.asm
+index 24386f8..b2228bb 100644
+--- a/libavcodec/x86/h264_weight_10bit.asm
++++ b/libavcodec/x86/h264_weight_10bit.asm
+@@ -22,7 +22,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA 32
+diff --git a/libavcodec/x86/imdct36.asm b/libavcodec/x86/imdct36.asm
+index 937a2cc..633fcd9 100644
+--- a/libavcodec/x86/imdct36.asm
++++ b/libavcodec/x86/imdct36.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "libavutil/x86/x86inc.asm"
+ %include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/pngdsp.asm b/libavcodec/x86/pngdsp.asm
+index 970f3db..e0b3871 100644
+--- a/libavcodec/x86/pngdsp.asm
++++ b/libavcodec/x86/pngdsp.asm
+@@ -21,7 +21,6 @@
+ ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm
+index bce36ac..5b7b7fc 100644
+--- a/libavcodec/x86/proresdsp.asm
++++ b/libavcodec/x86/proresdsp.asm
+@@ -21,7 +21,6 @@
+ ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ %define W1sh2 22725 ; W1 = 90901 = 22725<<2 + 1
+diff --git a/libavcodec/x86/rv34dsp.asm b/libavcodec/x86/rv34dsp.asm
+index 78d8c92..d6a2897 100644
+--- a/libavcodec/x86/rv34dsp.asm
++++ b/libavcodec/x86/rv34dsp.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/rv40dsp.asm b/libavcodec/x86/rv40dsp.asm
+index 70c0c04..834b12b 100644
+--- a/libavcodec/x86/rv40dsp.asm
++++ b/libavcodec/x86/rv40dsp.asm
+@@ -21,7 +21,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm
+index 47cb312..b10b424 100644
+--- a/libavcodec/x86/sbrdsp.asm
++++ b/libavcodec/x86/sbrdsp.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ ;SECTION_RODATA
+diff --git a/libavcodec/x86/vc1dsp.asm b/libavcodec/x86/vc1dsp.asm
+index ced2b5b..0aa4cf4 100644
+--- a/libavcodec/x86/vc1dsp.asm
++++ b/libavcodec/x86/vc1dsp.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ cextern pw_4
+diff --git a/libavcodec/x86/vp3dsp.asm b/libavcodec/x86/vp3dsp.asm
+index 7a88892..865f176 100644
+--- a/libavcodec/x86/vp3dsp.asm
++++ b/libavcodec/x86/vp3dsp.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ ; MMX-optimized functions cribbed from the original VP3 source code.
+diff --git a/libavcodec/x86/vp56dsp.asm b/libavcodec/x86/vp56dsp.asm
+index d80680f..f89ec7f 100644
+--- a/libavcodec/x86/vp56dsp.asm
++++ b/libavcodec/x86/vp56dsp.asm
+@@ -20,7 +20,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ cextern pw_64
+diff --git a/libavcodec/x86/vp8dsp.asm b/libavcodec/x86/vp8dsp.asm
+index ab58e95..b7355c4 100644
+--- a/libavcodec/x86/vp8dsp.asm
++++ b/libavcodec/x86/vp8dsp.asm
+@@ -20,7 +20,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libavfilter/x86/hqdn3d.asm b/libavfilter/x86/hqdn3d.asm
+index 7254194..a84c7b7 100644
+--- a/libavfilter/x86/hqdn3d.asm
++++ b/libavfilter/x86/hqdn3d.asm
+@@ -18,7 +18,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
++%include "x86util.asm"
+
+ SECTION .text
+
+diff --git a/libavresample/x86/audio_convert.asm b/libavresample/x86/audio_convert.asm
+index 25166af..a1213a6 100644
+--- a/libavresample/x86/audio_convert.asm
++++ b/libavresample/x86/audio_convert.asm
+@@ -20,7 +20,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+ %include "util.asm"
+
+diff --git a/libavresample/x86/audio_mix.asm b/libavresample/x86/audio_mix.asm
+index 0c4a9bd..13b364a 100644
+--- a/libavresample/x86/audio_mix.asm
++++ b/libavresample/x86/audio_mix.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+ %include "util.asm"
+
+diff --git a/libavutil/x86/cpuid.asm b/libavutil/x86/cpuid.asm
+index d2ac1f0..e739ebe 100644
+--- a/libavutil/x86/cpuid.asm
++++ b/libavutil/x86/cpuid.asm
+@@ -21,7 +21,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
++%include "x86util.asm"
+
+ SECTION .text
+
+diff --git a/libavutil/x86/float_dsp.asm b/libavutil/x86/float_dsp.asm
+index 5b9b444..bbc9a8b 100644
+--- a/libavutil/x86/float_dsp.asm
++++ b/libavutil/x86/float_dsp.asm
+@@ -18,7 +18,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION .text
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index a5d89a1..3aac639 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -23,6 +23,8 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
++%include "x86inc.asm"
++
+ %macro SBUTTERFLY 4
+ %if avx_enabled == 0
+ mova m%4, m%2
+diff --git a/libswscale/x86/input.asm b/libswscale/x86/input.asm
+index 66d8845..5d10e23 100644
+--- a/libswscale/x86/input.asm
++++ b/libswscale/x86/input.asm
+@@ -21,7 +21,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
+index 9b0b012..7a138d1 100644
+--- a/libswscale/x86/output.asm
++++ b/libswscale/x86/output.asm
+@@ -20,7 +20,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+diff --git a/libswscale/x86/scale.asm b/libswscale/x86/scale.asm
+index d56e253..3a36ee6 100644
+--- a/libswscale/x86/scale.asm
++++ b/libswscale/x86/scale.asm
+@@ -19,7 +19,6 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
+ %include "x86util.asm"
+
+ SECTION_RODATA
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0091-x86-yasm-Use-complete-source-path-for-macro-helper-i.patch b/debian/patches/post-9beta2/0091-x86-yasm-Use-complete-source-path-for-macro-helper-i.patch
new file mode 100644
index 0000000..746eae0
--- /dev/null
+++ b/debian/patches/post-9beta2/0091-x86-yasm-Use-complete-source-path-for-macro-helper-i.patch
@@ -0,0 +1,490 @@
+From 04581c8c77ce779e4e70684ac45302972766be0f Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 15 Jul 2012 11:48:21 +0200
+Subject: [PATCH 091/204] x86: yasm: Use complete source path for macro helper
+ %includes
+
+This is more consistent with the way we handle C #includes and
+it simplifies the build system.
+---
+ Makefile | 2 +-
+ libavcodec/x86/ac3dsp.asm | 2 +-
+ libavcodec/x86/dct32.asm | 2 +-
+ libavcodec/x86/deinterlace.asm | 2 +-
+ libavcodec/x86/dsputil.asm | 2 +-
+ libavcodec/x86/dsputilenc.asm | 2 +-
+ libavcodec/x86/fft.asm | 2 +-
+ libavcodec/x86/fmtconvert.asm | 2 +-
+ libavcodec/x86/h264_chromamc.asm | 2 +-
+ libavcodec/x86/h264_chromamc_10bit.asm | 2 +-
+ libavcodec/x86/h264_deblock.asm | 2 +-
+ libavcodec/x86/h264_deblock_10bit.asm | 2 +-
+ libavcodec/x86/h264_idct.asm | 2 +-
+ libavcodec/x86/h264_idct_10bit.asm | 2 +-
+ libavcodec/x86/h264_intrapred.asm | 2 +-
+ libavcodec/x86/h264_intrapred_10bit.asm | 2 +-
+ libavcodec/x86/h264_qpel_10bit.asm | 2 +-
+ libavcodec/x86/h264_weight.asm | 2 +-
+ libavcodec/x86/h264_weight_10bit.asm | 2 +-
+ libavcodec/x86/pngdsp.asm | 2 +-
+ libavcodec/x86/proresdsp.asm | 2 +-
+ libavcodec/x86/rv34dsp.asm | 2 +-
+ libavcodec/x86/rv40dsp.asm | 2 +-
+ libavcodec/x86/sbrdsp.asm | 2 +-
+ libavcodec/x86/vc1dsp.asm | 2 +-
+ libavcodec/x86/vp3dsp.asm | 2 +-
+ libavcodec/x86/vp56dsp.asm | 2 +-
+ libavcodec/x86/vp8dsp.asm | 2 +-
+ libavfilter/x86/hqdn3d.asm | 2 +-
+ libavresample/x86/audio_convert.asm | 2 +-
+ libavresample/x86/audio_mix.asm | 2 +-
+ libswscale/x86/input.asm | 2 +-
+ libswscale/x86/output.asm | 2 +-
+ libswscale/x86/scale.asm | 2 +-
+ 34 files changed, 34 insertions(+), 34 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 1f73a0a..5e1dae6 100644
+--- a/Makefile
++++ b/Makefile
+@@ -27,7 +27,7 @@ CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
+ CFLAGS += $(ECFLAGS)
+ CCFLAGS = $(CPPFLAGS) $(CFLAGS)
+ ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
+-YASMFLAGS += $(IFLAGS:%=%/) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
++YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
+ HOSTCCFLAGS = $(IFLAGS) $(HOSTCFLAGS)
+ LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
+
+diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
+index 01c1b8e..724b0dc 100644
+--- a/libavcodec/x86/ac3dsp.asm
++++ b/libavcodec/x86/ac3dsp.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/dct32.asm b/libavcodec/x86/dct32.asm
+index 53c2415..25bc8f7 100644
+--- a/libavcodec/x86/dct32.asm
++++ b/libavcodec/x86/dct32.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA 32
+
+diff --git a/libavcodec/x86/deinterlace.asm b/libavcodec/x86/deinterlace.asm
+index f15b8ea..b2828f3 100644
+--- a/libavcodec/x86/deinterlace.asm
++++ b/libavcodec/x86/deinterlace.asm
+@@ -20,7 +20,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/dsputil.asm b/libavcodec/x86/dsputil.asm
+index 4b36ca8..0ed64aa 100644
+--- a/libavcodec/x86/dsputil.asm
++++ b/libavcodec/x86/dsputil.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+ pb_f: times 16 db 15
+diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm
+index 39031cb..597f894 100644
+--- a/libavcodec/x86/dsputilenc.asm
++++ b/libavcodec/x86/dsputilenc.asm
+@@ -21,7 +21,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;*****************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION .text
+
+diff --git a/libavcodec/x86/fft.asm b/libavcodec/x86/fft.asm
+index 465c08b..8c69f1f 100644
+--- a/libavcodec/x86/fft.asm
++++ b/libavcodec/x86/fft.asm
+@@ -28,7 +28,7 @@
+ ; in blocks as conventient to the vector size.
+ ; i.e. {4x real, 4x imaginary, 4x real, ...} (or 2x respectively)
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ %if ARCH_X86_64
+ %define pointer resq
+diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm
+index d59c43b..2951b16 100644
+--- a/libavcodec/x86/fmtconvert.asm
++++ b/libavcodec/x86/fmtconvert.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_TEXT
+
+diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm
+index 4651883..e3aff0b 100644
+--- a/libavcodec/x86/h264_chromamc.asm
++++ b/libavcodec/x86/h264_chromamc.asm
+@@ -20,7 +20,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/h264_chromamc_10bit.asm b/libavcodec/x86/h264_chromamc_10bit.asm
+index 254c69f..4481efe 100644
+--- a/libavcodec/x86/h264_chromamc_10bit.asm
++++ b/libavcodec/x86/h264_chromamc_10bit.asm
+@@ -22,7 +22,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
+index 103fb0d..f5de7c9 100644
+--- a/libavcodec/x86/h264_deblock.asm
++++ b/libavcodec/x86/h264_deblock.asm
+@@ -24,7 +24,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/h264_deblock_10bit.asm b/libavcodec/x86/h264_deblock_10bit.asm
+index e718613..e105c6c 100644
+--- a/libavcodec/x86/h264_deblock_10bit.asm
++++ b/libavcodec/x86/h264_deblock_10bit.asm
+@@ -24,7 +24,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm
+index 5ae3263..5d861d3 100644
+--- a/libavcodec/x86/h264_idct.asm
++++ b/libavcodec/x86/h264_idct.asm
+@@ -26,7 +26,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;*****************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/h264_idct_10bit.asm b/libavcodec/x86/h264_idct_10bit.asm
+index ad923f9..5ba241b 100644
+--- a/libavcodec/x86/h264_idct_10bit.asm
++++ b/libavcodec/x86/h264_idct_10bit.asm
+@@ -22,7 +22,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
+index 3a5a6d4..94d979c 100644
+--- a/libavcodec/x86/h264_intrapred.asm
++++ b/libavcodec/x86/h264_intrapred.asm
+@@ -22,7 +22,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/h264_intrapred_10bit.asm b/libavcodec/x86/h264_intrapred_10bit.asm
+index 98c9118..50ebaa7 100644
+--- a/libavcodec/x86/h264_intrapred_10bit.asm
++++ b/libavcodec/x86/h264_intrapred_10bit.asm
+@@ -22,7 +22,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/h264_qpel_10bit.asm b/libavcodec/x86/h264_qpel_10bit.asm
+index 0a9c433..a84b810 100644
+--- a/libavcodec/x86/h264_qpel_10bit.asm
++++ b/libavcodec/x86/h264_qpel_10bit.asm
+@@ -22,7 +22,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA 32
+
+diff --git a/libavcodec/x86/h264_weight.asm b/libavcodec/x86/h264_weight.asm
+index 6fe9a40..bc3fb4b 100644
+--- a/libavcodec/x86/h264_weight.asm
++++ b/libavcodec/x86/h264_weight.asm
+@@ -21,7 +21,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION .text
+
+diff --git a/libavcodec/x86/h264_weight_10bit.asm b/libavcodec/x86/h264_weight_10bit.asm
+index b2228bb..20d26a4 100644
+--- a/libavcodec/x86/h264_weight_10bit.asm
++++ b/libavcodec/x86/h264_weight_10bit.asm
+@@ -22,7 +22,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA 32
+
+diff --git a/libavcodec/x86/pngdsp.asm b/libavcodec/x86/pngdsp.asm
+index e0b3871..1573363 100644
+--- a/libavcodec/x86/pngdsp.asm
++++ b/libavcodec/x86/pngdsp.asm
+@@ -21,7 +21,7 @@
+ ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm
+index 5b7b7fc..91e0800 100644
+--- a/libavcodec/x86/proresdsp.asm
++++ b/libavcodec/x86/proresdsp.asm
+@@ -21,7 +21,7 @@
+ ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ %define W1sh2 22725 ; W1 = 90901 = 22725<<2 + 1
+ %define W2sh2 21407 ; W2 = 85627 = 21407<<2 - 1
+diff --git a/libavcodec/x86/rv34dsp.asm b/libavcodec/x86/rv34dsp.asm
+index d6a2897..2f12446 100644
+--- a/libavcodec/x86/rv34dsp.asm
++++ b/libavcodec/x86/rv34dsp.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+ pw_row_coeffs: times 4 dw 13
+diff --git a/libavcodec/x86/rv40dsp.asm b/libavcodec/x86/rv40dsp.asm
+index 834b12b..02267ef 100644
+--- a/libavcodec/x86/rv40dsp.asm
++++ b/libavcodec/x86/rv40dsp.asm
+@@ -21,7 +21,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm
+index b10b424..c351de4 100644
+--- a/libavcodec/x86/sbrdsp.asm
++++ b/libavcodec/x86/sbrdsp.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ ;SECTION_RODATA
+ SECTION .text
+diff --git a/libavcodec/x86/vc1dsp.asm b/libavcodec/x86/vc1dsp.asm
+index 0aa4cf4..e759cf5 100644
+--- a/libavcodec/x86/vc1dsp.asm
++++ b/libavcodec/x86/vc1dsp.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ cextern pw_4
+ cextern pw_5
+diff --git a/libavcodec/x86/vp3dsp.asm b/libavcodec/x86/vp3dsp.asm
+index 865f176..d300304 100644
+--- a/libavcodec/x86/vp3dsp.asm
++++ b/libavcodec/x86/vp3dsp.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ ; MMX-optimized functions cribbed from the original VP3 source code.
+
+diff --git a/libavcodec/x86/vp56dsp.asm b/libavcodec/x86/vp56dsp.asm
+index f89ec7f..80f8ca5 100644
+--- a/libavcodec/x86/vp56dsp.asm
++++ b/libavcodec/x86/vp56dsp.asm
+@@ -20,7 +20,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ cextern pw_64
+
+diff --git a/libavcodec/x86/vp8dsp.asm b/libavcodec/x86/vp8dsp.asm
+index b7355c4..5dc4ca3 100644
+--- a/libavcodec/x86/vp8dsp.asm
++++ b/libavcodec/x86/vp8dsp.asm
+@@ -20,7 +20,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libavfilter/x86/hqdn3d.asm b/libavfilter/x86/hqdn3d.asm
+index a84c7b7..dee2c96 100644
+--- a/libavfilter/x86/hqdn3d.asm
++++ b/libavfilter/x86/hqdn3d.asm
+@@ -18,7 +18,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION .text
+
+diff --git a/libavresample/x86/audio_convert.asm b/libavresample/x86/audio_convert.asm
+index a1213a6..e7f7157 100644
+--- a/libavresample/x86/audio_convert.asm
++++ b/libavresample/x86/audio_convert.asm
+@@ -20,7 +20,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+ %include "util.asm"
+
+ SECTION_RODATA 32
+diff --git a/libavresample/x86/audio_mix.asm b/libavresample/x86/audio_mix.asm
+index 13b364a..7f3b5b9 100644
+--- a/libavresample/x86/audio_mix.asm
++++ b/libavresample/x86/audio_mix.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+ %include "util.asm"
+
+ SECTION_TEXT
+diff --git a/libswscale/x86/input.asm b/libswscale/x86/input.asm
+index 5d10e23..a8d5a5a 100644
+--- a/libswscale/x86/input.asm
++++ b/libswscale/x86/input.asm
+@@ -21,7 +21,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
+index 7a138d1..c29aa7e 100644
+--- a/libswscale/x86/output.asm
++++ b/libswscale/x86/output.asm
+@@ -20,7 +20,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+diff --git a/libswscale/x86/scale.asm b/libswscale/x86/scale.asm
+index 3a36ee6..440a27b 100644
+--- a/libswscale/x86/scale.asm
++++ b/libswscale/x86/scale.asm
+@@ -19,7 +19,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86util.asm"
++%include "libavutil/x86/x86util.asm"
+
+ SECTION_RODATA
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0092-x86-mmx2-mmxext-in-comments-and-messages.patch b/debian/patches/post-9beta2/0092-x86-mmx2-mmxext-in-comments-and-messages.patch
new file mode 100644
index 0000000..6cfd154
--- /dev/null
+++ b/debian/patches/post-9beta2/0092-x86-mmx2-mmxext-in-comments-and-messages.patch
@@ -0,0 +1,265 @@
+From 652f5185945c8405fc57aed353286858df8d066f Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 8 Jul 2012 19:16:20 +0200
+Subject: [PATCH 092/204] x86: mmx2 ---> mmxext in comments and messages
+
+---
+ doc/optimization.txt | 2 +-
+ doc/swscale.txt | 2 +-
+ libavcodec/x86/dsputil_avg_template.c | 2 +-
+ libavcodec/x86/dsputil_mmx.c | 4 ++--
+ libswscale/rgb2rgb.c | 2 +-
+ libswscale/rgb2rgb_template.c | 2 +-
+ libswscale/swscale_internal.h | 8 ++++----
+ libswscale/utils.c | 6 +++---
+ libswscale/x86/output.asm | 4 ++--
+ libswscale/x86/rgb2rgb.c | 6 +++---
+ libswscale/x86/rgb2rgb_template.c | 2 +-
+ libswscale/x86/swscale.c | 2 +-
+ libswscale/x86/swscale_template.c | 2 +-
+ libswscale/x86/yuv2rgb.c | 4 ++--
+ 14 files changed, 24 insertions(+), 24 deletions(-)
+
+diff --git a/doc/optimization.txt b/doc/optimization.txt
+index 78e0077..c3e640c 100644
+--- a/doc/optimization.txt
++++ b/doc/optimization.txt
+@@ -253,7 +253,7 @@ Optimization guide for ARM11 (used in Nokia N800 Internet Tablet):
+ http://infocenter.arm.com/help/topic/com.arm.doc.ddi0211j/DDI0211J_arm1136_r1p5_trm.pdf
+ Optimization guide for Intel XScale (used in Sharp Zaurus PDA):
+ http://download.intel.com/design/intelxscale/27347302.pdf
+-Intel Wireless MMX2 Coprocessor: Programmers Reference Manual
++Intel Wireless MMX 2 Coprocessor: Programmers Reference Manual
+ http://download.intel.com/design/intelxscale/31451001.pdf
+
+ PowerPC-specific:
+diff --git a/doc/swscale.txt b/doc/swscale.txt
+index 0dc4b8a..2066009 100644
+--- a/doc/swscale.txt
++++ b/doc/swscale.txt
+@@ -58,7 +58,7 @@ Input to YUV Converter
+
+ Horizontal scaler
+ There are several horizontal scalers. A special case worth mentioning is
+- the fast bilinear scaler that is made of runtime-generated MMX2 code
++ the fast bilinear scaler that is made of runtime-generated MMXEXT code
+ using specially tuned pshufw instructions.
+ The remaining scalers are specially-tuned for various filter lengths.
+ They scale 8-bit unsigned planar data to 16-bit signed planar data.
+diff --git a/libavcodec/x86/dsputil_avg_template.c b/libavcodec/x86/dsputil_avg_template.c
+index 8b116b7..89eaedf 100644
+--- a/libavcodec/x86/dsputil_avg_template.c
++++ b/libavcodec/x86/dsputil_avg_template.c
+@@ -1,5 +1,5 @@
+ /*
+- * DSP utils : average functions are compiled twice for 3dnow/mmx2
++ * DSP utils : average functions are compiled twice for 3dnow/mmxext
+ * Copyright (c) 2000, 2001 Fabrice Bellard
+ * Copyright (c) 2002-2004 Michael Niedermayer
+ *
+diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
+index 86a08cb..ef843b5 100644
+--- a/libavcodec/x86/dsputil_mmx.c
++++ b/libavcodec/x86/dsputil_mmx.c
+@@ -205,11 +205,11 @@ DECLARE_ALIGNED(16, const double, ff_pd_2)[2] = { 2.0, 2.0 };
+ #undef OP_AVG
+
+ /***********************************/
+-/* MMX2 specific */
++/* MMXEXT specific */
+
+ #define DEF(x) x ## _mmx2
+
+-/* Introduced only in MMX2 set */
++/* Introduced only in MMXEXT set */
+ #define PAVGB "pavgb"
+ #define OP_AVG PAVGB
+
+diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
+index 26ef648..c261fe6 100644
+--- a/libswscale/rgb2rgb.c
++++ b/libswscale/rgb2rgb.c
+@@ -122,7 +122,7 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
+ /*
+ * RGB15->RGB16 original by Strepto/Astral
+ * ported to gcc & bugfixed : A'rpi
+- * MMX2, 3DNOW optimization by Nick Kurshev
++ * MMXEXT, 3DNOW optimization by Nick Kurshev
+ * 32-bit C version, and and&add trick by Michael Niedermayer
+ */
+
+diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
+index d1a43e0..3785ef9 100644
+--- a/libswscale/rgb2rgb_template.c
++++ b/libswscale/rgb2rgb_template.c
+@@ -77,7 +77,7 @@ static inline void rgb32tobgr24_c(const uint8_t *src, uint8_t *dst,
+ /*
+ * original by Strepto/Astral
+ * ported to gcc & bugfixed: A'rpi
+- * MMX2, 3DNOW optimization by Nick Kurshev
++ * MMXEXT, 3DNOW optimization by Nick Kurshev
+ * 32-bit C version, and and&add trick by Michael Niedermayer
+ */
+ static inline void rgb15to16_c(const uint8_t *src, uint8_t *dst, int src_size)
+diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
+index 011626a..c239c2a 100644
+--- a/libswscale/swscale_internal.h
++++ b/libswscale/swscale_internal.h
+@@ -307,10 +307,10 @@ typedef struct SwsContext {
+ int vChrFilterSize; ///< Vertical filter size for chroma pixels.
+ //@}
+
+- int lumMmx2FilterCodeSize; ///< Runtime-generated MMX2 horizontal fast bilinear scaler code size for luma/alpha planes.
+- int chrMmx2FilterCodeSize; ///< Runtime-generated MMX2 horizontal fast bilinear scaler code size for chroma planes.
+- uint8_t *lumMmx2FilterCode; ///< Runtime-generated MMX2 horizontal fast bilinear scaler code for luma/alpha planes.
+- uint8_t *chrMmx2FilterCode; ///< Runtime-generated MMX2 horizontal fast bilinear scaler code for chroma planes.
++ int lumMmx2FilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.
++ int chrMmx2FilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
++ uint8_t *lumMmx2FilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
++ uint8_t *chrMmx2FilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
+
+ int canMMX2BeUsed;
+
+diff --git a/libswscale/utils.c b/libswscale/utils.c
+index f68f120..9e5ebac 100644
+--- a/libswscale/utils.c
++++ b/libswscale/utils.c
+@@ -616,7 +616,7 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode,
+ int xpos, i;
+
+ // create an optimized horizontal scaling routine
+- /* This scaler is made of runtime-generated MMX2 code using specially tuned
++ /* This scaler is made of runtime-generated MMXEXT code using specially tuned
+ * pshufw instructions. For every four output pixels, if four input pixels
+ * are enough for the fast bilinear scaling, then a chunk of fragmentB is
+ * used. If five input pixels are needed, then a chunk of fragmentA is used.
+@@ -1007,7 +1007,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
+ && (flags & SWS_FAST_BILINEAR)) {
+ if (flags & SWS_PRINT_INFO)
+ av_log(c, AV_LOG_INFO,
+- "output width is not a multiple of 32 -> no MMX2 scaler\n");
++ "output width is not a multiple of 32 -> no MMXEXT scaler\n");
+ }
+ if (usesHFilter)
+ c->canMMX2BeUsed = 0;
+@@ -1237,7 +1237,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
+ sws_format_name(dstFormat));
+
+ if (INLINE_MMXEXT(cpu_flags))
+- av_log(c, AV_LOG_INFO, "using MMX2\n");
++ av_log(c, AV_LOG_INFO, "using MMXEXT\n");
+ else if (INLINE_AMD3DNOW(cpu_flags))
+ av_log(c, AV_LOG_INFO, "using 3DNOW\n");
+ else if (INLINE_MMX(cpu_flags))
+diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
+index c29aa7e..cf0dec3 100644
+--- a/libswscale/x86/output.asm
++++ b/libswscale/x86/output.asm
+@@ -218,10 +218,10 @@ cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset
+ %else ; %1 == 9/10
+ %if cpuflag(sse4)
+ packusdw m2, m1
+-%else ; mmx2/sse2
++%else ; mmxext/sse2
+ packssdw m2, m1
+ pmaxsw m2, m6
+-%endif ; mmx2/sse2/sse4/avx
++%endif ; mmxext/sse2/sse4/avx
+ pminsw m2, [yuv2yuvX_%1_upper]
+ %endif ; %1 == 9/10/16
+ mova [dstq+r5*2], m2
+diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
+index 5962680..486f436 100644
+--- a/libswscale/x86/rgb2rgb.c
++++ b/libswscale/x86/rgb2rgb.c
+@@ -84,7 +84,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
+ #define RV ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))
+ #define RU ((int)(-0.148*(1<<RGB2YUV_SHIFT)+0.5))
+
+-//Note: We have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW + MMX2 one.
++// Note: We have C, MMX, MMXEXT, 3DNOW versions, there is no 3DNOW + MMXEXT one.
+
+ #define COMPILE_TEMPLATE_MMXEXT 0
+ #define COMPILE_TEMPLATE_AMD3DNOW 0
+@@ -95,7 +95,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
+ #define RENAME(a) a ## _MMX
+ #include "rgb2rgb_template.c"
+
+-//MMX2 versions
++// MMXEXT versions
+ #undef RENAME
+ #undef COMPILE_TEMPLATE_MMXEXT
+ #define COMPILE_TEMPLATE_MMXEXT 1
+@@ -123,7 +123,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
+ /*
+ RGB15->RGB16 original by Strepto/Astral
+ ported to gcc & bugfixed : A'rpi
+- MMX2, 3DNOW optimization by Nick Kurshev
++ MMXEXT, 3DNOW optimization by Nick Kurshev
+ 32-bit C version, and and&add trick by Michael Niedermayer
+ */
+
+diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c
+index f312053..205b749 100644
+--- a/libswscale/x86/rgb2rgb_template.c
++++ b/libswscale/x86/rgb2rgb_template.c
+@@ -181,7 +181,7 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int sr
+ /*
+ original by Strepto/Astral
+ ported to gcc & bugfixed: A'rpi
+- MMX2, 3DNOW optimization by Nick Kurshev
++ MMXEXT, 3DNOW optimization by Nick Kurshev
+ 32-bit C version, and and&add trick by Michael Niedermayer
+ */
+ static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size)
+diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
+index ba7990e..fc74d97 100644
+--- a/libswscale/x86/swscale.c
++++ b/libswscale/x86/swscale.c
+@@ -78,7 +78,7 @@ DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL;
+ #include "swscale_template.c"
+ #endif
+
+-//MMX2 versions
++// MMXEXT versions
+ #if HAVE_MMXEXT_INLINE
+ #undef RENAME
+ #undef COMPILE_TEMPLATE_MMXEXT
+diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
+index 0d5ba7e..8be6398 100644
+--- a/libswscale/x86/swscale_template.c
++++ b/libswscale/x86/swscale_template.c
+@@ -1615,7 +1615,7 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
+ }
+
+ if (c->srcBpc == 8 && c->dstBpc <= 10) {
+- // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one).
++ // Use the new MMX scaler if the MMXEXT one can't be used (it is faster than the x86 ASM one).
+ #if COMPILE_TEMPLATE_MMXEXT
+ if (c->flags & SWS_FAST_BILINEAR && c->canMMX2BeUsed)
+ {
+diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c
+index b7d8f42..17ac3e2 100644
+--- a/libswscale/x86/yuv2rgb.c
++++ b/libswscale/x86/yuv2rgb.c
+@@ -3,7 +3,7 @@
+ *
+ * Copyright (C) 2009 Konstantin Shishkov
+ *
+- * MMX/MMX2 template stuff (needed for fast movntq support),
++ * MMX/MMXEXT template stuff (needed for fast movntq support),
+ * 1,4,8bpp support and context / deglobalize stuff
+ * by Michael Niedermayer (michaelni at gmx.at)
+ *
+@@ -58,7 +58,7 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL;
+ #include "yuv2rgb_template.c"
+ #endif /* HAVE_MMX_INLINE */
+
+-//MMX2 versions
++// MMXEXT versions
+ #if HAVE_MMXEXT_INLINE
+ #undef RENAME
+ #undef COMPILE_TEMPLATE_MMXEXT
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0093-x86-mmx2-mmxext-in-variable-names.patch b/debian/patches/post-9beta2/0093-x86-mmx2-mmxext-in-variable-names.patch
new file mode 100644
index 0000000..2923c4d
--- /dev/null
+++ b/debian/patches/post-9beta2/0093-x86-mmx2-mmxext-in-variable-names.patch
@@ -0,0 +1,224 @@
+From a65bdceb060628881578afb29df4eb222421381f Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 8 Jul 2012 19:55:31 +0200
+Subject: [PATCH 093/204] x86: mmx2 ---> mmxext in variable names
+
+---
+ libswscale/swscale_internal.h | 10 ++---
+ libswscale/utils.c | 80 +++++++++++++++++++++----------------
+ libswscale/x86/swscale_template.c | 11 +++--
+ 3 files changed, 56 insertions(+), 45 deletions(-)
+
+diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
+index c239c2a..8752672 100644
+--- a/libswscale/swscale_internal.h
++++ b/libswscale/swscale_internal.h
+@@ -307,12 +307,12 @@ typedef struct SwsContext {
+ int vChrFilterSize; ///< Vertical filter size for chroma pixels.
+ //@}
+
+- int lumMmx2FilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.
+- int chrMmx2FilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
+- uint8_t *lumMmx2FilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
+- uint8_t *chrMmx2FilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
++ int lumMmxextFilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.
++ int chrMmxextFilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
++ uint8_t *lumMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
++ uint8_t *chrMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
+
+- int canMMX2BeUsed;
++ int canMMXEXTBeUsed;
+
+ int dstY; ///< Last destination vertical line output from last slice.
+ int flags; ///< Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc...
+diff --git a/libswscale/utils.c b/libswscale/utils.c
+index 9e5ebac..64a3a58 100644
+--- a/libswscale/utils.c
++++ b/libswscale/utils.c
+@@ -1001,18 +1001,18 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
+ (FFALIGN(srcW, 16) * 2 * FFALIGN(c->srcBpc, 8) >> 3) + 16,
+ fail);
+ if (INLINE_MMXEXT(cpu_flags) && c->srcBpc == 8 && c->dstBpc <= 10) {
+- c->canMMX2BeUsed = (dstW >= srcW && (dstW & 31) == 0 &&
+- (srcW & 15) == 0) ? 1 : 0;
+- if (!c->canMMX2BeUsed && dstW >= srcW && (srcW & 15) == 0
++ c->canMMXEXTBeUsed = (dstW >= srcW && (dstW & 31) == 0 &&
++ (srcW & 15) == 0) ? 1 : 0;
++ if (!c->canMMXEXTBeUsed && dstW >= srcW && (srcW & 15) == 0
+ && (flags & SWS_FAST_BILINEAR)) {
+ if (flags & SWS_PRINT_INFO)
+ av_log(c, AV_LOG_INFO,
+ "output width is not a multiple of 32 -> no MMXEXT scaler\n");
+ }
+ if (usesHFilter)
+- c->canMMX2BeUsed = 0;
++ c->canMMXEXTBeUsed = 0;
+ } else
+- c->canMMX2BeUsed = 0;
++ c->canMMXEXTBeUsed = 0;
+
+ c->chrXInc = (((int64_t)c->chrSrcW << 16) + (c->chrDstW >> 1)) / c->chrDstW;
+ c->chrYInc = (((int64_t)c->chrSrcH << 16) + (c->chrDstH >> 1)) / c->chrDstH;
+@@ -1025,7 +1025,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
+ * correct variant would be like the vertical one, but that would require
+ * some special code for the first and last pixel */
+ if (flags & SWS_FAST_BILINEAR) {
+- if (c->canMMX2BeUsed) {
++ if (c->canMMXEXTBeUsed) {
+ c->lumXInc += 20;
+ c->chrXInc += 20;
+ }
+@@ -1042,38 +1042,50 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
+ {
+ #if HAVE_MMXEXT_INLINE
+ // can't downscale !!!
+- if (c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR)) {
+- c->lumMmx2FilterCodeSize = initMMX2HScaler(dstW, c->lumXInc, NULL,
+- NULL, NULL, 8);
+- c->chrMmx2FilterCodeSize = initMMX2HScaler(c->chrDstW, c->chrXInc,
+- NULL, NULL, NULL, 4);
++ if (c->canMMXEXTBeUsed && (flags & SWS_FAST_BILINEAR)) {
++ c->lumMmxextFilterCodeSize = initMMX2HScaler(dstW, c->lumXInc, NULL,
++ NULL, NULL, 8);
++ c->chrMmxextFilterCodeSize = initMMX2HScaler(c->chrDstW, c->chrXInc,
++ NULL, NULL, NULL, 4);
+
+ #if USE_MMAP
+- c->lumMmx2FilterCode = mmap(NULL, c->lumMmx2FilterCodeSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+- c->chrMmx2FilterCode = mmap(NULL, c->chrMmx2FilterCodeSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
++ c->lumMmxextFilterCode = mmap(NULL, c->lumMmxextFilterCodeSize,
++ PROT_READ | PROT_WRITE,
++ MAP_PRIVATE | MAP_ANONYMOUS,
++ -1, 0);
++ c->chrMmxextFilterCode = mmap(NULL, c->chrMmxextFilterCodeSize,
++ PROT_READ | PROT_WRITE,
++ MAP_PRIVATE | MAP_ANONYMOUS,
++ -1, 0);
+ #elif HAVE_VIRTUALALLOC
+- c->lumMmx2FilterCode = VirtualAlloc(NULL, c->lumMmx2FilterCodeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
+- c->chrMmx2FilterCode = VirtualAlloc(NULL, c->chrMmx2FilterCodeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
++ c->lumMmxextFilterCode = VirtualAlloc(NULL,
++ c->lumMmxextFilterCodeSize,
++ MEM_COMMIT,
++ PAGE_EXECUTE_READWRITE);
++ c->chrMmxextFilterCode = VirtualAlloc(NULL,
++ c->chrMmxextFilterCodeSize,
++ MEM_COMMIT,
++ PAGE_EXECUTE_READWRITE);
+ #else
+- c->lumMmx2FilterCode = av_malloc(c->lumMmx2FilterCodeSize);
+- c->chrMmx2FilterCode = av_malloc(c->chrMmx2FilterCodeSize);
++ c->lumMmxextFilterCode = av_malloc(c->lumMmxextFilterCodeSize);
++ c->chrMmxextFilterCode = av_malloc(c->chrMmxextFilterCodeSize);
+ #endif
+
+- if (!c->lumMmx2FilterCode || !c->chrMmx2FilterCode)
++ if (!c->lumMmxextFilterCode || !c->chrMmxextFilterCode)
+ return AVERROR(ENOMEM);
+ FF_ALLOCZ_OR_GOTO(c, c->hLumFilter, (dstW / 8 + 8) * sizeof(int16_t), fail);
+ FF_ALLOCZ_OR_GOTO(c, c->hChrFilter, (c->chrDstW / 4 + 8) * sizeof(int16_t), fail);
+ FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW / 2 / 8 + 8) * sizeof(int32_t), fail);
+ FF_ALLOCZ_OR_GOTO(c, c->hChrFilterPos, (c->chrDstW / 2 / 4 + 8) * sizeof(int32_t), fail);
+
+- initMMX2HScaler(dstW, c->lumXInc, c->lumMmx2FilterCode,
++ initMMX2HScaler(dstW, c->lumXInc, c->lumMmxextFilterCode,
+ c->hLumFilter, c->hLumFilterPos, 8);
+- initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode,
++ initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmxextFilterCode,
+ c->hChrFilter, c->hChrFilterPos, 4);
+
+ #if USE_MMAP
+- mprotect(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize, PROT_EXEC | PROT_READ);
+- mprotect(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize, PROT_EXEC | PROT_READ);
++ mprotect(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ);
++ mprotect(c->chrMmxextFilterCode, c->chrMmxextFilterCodeSize, PROT_EXEC | PROT_READ);
+ #endif
+ } else
+ #endif /* HAVE_MMXEXT_INLINE */
+@@ -1651,21 +1663,21 @@ void sws_freeContext(SwsContext *c)
+
+ #if HAVE_MMX_INLINE
+ #if USE_MMAP
+- if (c->lumMmx2FilterCode)
+- munmap(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize);
+- if (c->chrMmx2FilterCode)
+- munmap(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize);
++ if (c->lumMmxextFilterCode)
++ munmap(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize);
++ if (c->chrMmxextFilterCode)
++ munmap(c->chrMmxextFilterCode, c->chrMmxextFilterCodeSize);
+ #elif HAVE_VIRTUALALLOC
+- if (c->lumMmx2FilterCode)
+- VirtualFree(c->lumMmx2FilterCode, 0, MEM_RELEASE);
+- if (c->chrMmx2FilterCode)
+- VirtualFree(c->chrMmx2FilterCode, 0, MEM_RELEASE);
++ if (c->lumMmxextFilterCode)
++ VirtualFree(c->lumMmxextFilterCode, 0, MEM_RELEASE);
++ if (c->chrMmxextFilterCode)
++ VirtualFree(c->chrMmxextFilterCode, 0, MEM_RELEASE);
+ #else
+- av_free(c->lumMmx2FilterCode);
+- av_free(c->chrMmx2FilterCode);
++ av_free(c->lumMmxextFilterCode);
++ av_free(c->chrMmxextFilterCode);
+ #endif
+- c->lumMmx2FilterCode = NULL;
+- c->chrMmx2FilterCode = NULL;
++ c->lumMmxextFilterCode = NULL;
++ c->chrMmxextFilterCode = NULL;
+ #endif /* HAVE_MMX_INLINE */
+
+ av_freep(&c->yuvTable);
+diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
+index 8be6398..d7a2fdb 100644
+--- a/libswscale/x86/swscale_template.c
++++ b/libswscale/x86/swscale_template.c
+@@ -1378,7 +1378,7 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
+ {
+ int32_t *filterPos = c->hLumFilterPos;
+ int16_t *filter = c->hLumFilter;
+- void *mmx2FilterCode= c->lumMmx2FilterCode;
++ void *mmxextFilterCode = c->lumMmxextFilterCode;
+ int i;
+ #if defined(PIC)
+ uint64_t ebxsave;
+@@ -1451,7 +1451,7 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
+ #endif
+ #endif
+ :: "m" (src), "m" (dst), "m" (filter), "m" (filterPos),
+- "m" (mmx2FilterCode)
++ "m" (mmxextFilterCode)
+ #if defined(PIC)
+ ,"m" (ebxsave)
+ #endif
+@@ -1474,7 +1474,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
+ {
+ int32_t *filterPos = c->hChrFilterPos;
+ int16_t *filter = c->hChrFilter;
+- void *mmx2FilterCode= c->chrMmx2FilterCode;
++ void *mmxextFilterCode = c->chrMmxextFilterCode;
+ int i;
+ #if defined(PIC)
+ DECLARE_ALIGNED(8, uint64_t, ebxsave);
+@@ -1535,7 +1535,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
+ #endif
+ #endif
+ :: "m" (src1), "m" (dst1), "m" (filter), "m" (filterPos),
+- "m" (mmx2FilterCode), "m" (src2), "m"(dst2)
++ "m" (mmxextFilterCode), "m" (src2), "m"(dst2)
+ #if defined(PIC)
+ ,"m" (ebxsave)
+ #endif
+@@ -1617,8 +1617,7 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
+ if (c->srcBpc == 8 && c->dstBpc <= 10) {
+ // Use the new MMX scaler if the MMXEXT one can't be used (it is faster than the x86 ASM one).
+ #if COMPILE_TEMPLATE_MMXEXT
+- if (c->flags & SWS_FAST_BILINEAR && c->canMMX2BeUsed)
+- {
++ if (c->flags & SWS_FAST_BILINEAR && c->canMMXEXTBeUsed) {
+ c->hyscale_fast = RENAME(hyscale_fast);
+ c->hcscale_fast = RENAME(hcscale_fast);
+ } else {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0094-x86-MMX2-MMXEXT-in-macro-names.patch b/debian/patches/post-9beta2/0094-x86-MMX2-MMXEXT-in-macro-names.patch
new file mode 100644
index 0000000..c727976
--- /dev/null
+++ b/debian/patches/post-9beta2/0094-x86-MMX2-MMXEXT-in-macro-names.patch
@@ -0,0 +1,490 @@
+From 588fafe7f3bdce1b7265b74320e9bdfad3e25960 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 8 Jul 2012 19:28:57 +0200
+Subject: [PATCH 094/204] x86: MMX2 ---> MMXEXT in macro names
+
+---
+ libavcodec/x86/ac3dsp.asm | 2 +-
+ libavcodec/x86/cavsdsp.c | 4 ++--
+ libavcodec/x86/dsputil_mmx.c | 14 ++++++-------
+ libavcodec/x86/dsputilenc.asm | 8 ++++----
+ libavcodec/x86/dsputilenc_mmx.c | 8 ++++----
+ libavcodec/x86/h264_idct.asm | 40 ++++++++++++++++++-------------------
+ libavcodec/x86/h264_qpel.c | 12 +++++------
+ libavcodec/x86/vc1dsp.asm | 2 +-
+ libavutil/x86/x86util.asm | 6 +++---
+ libswscale/x86/swscale_template.c | 40 ++++++++++++++++++-------------------
+ 10 files changed, 68 insertions(+), 68 deletions(-)
+
+diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
+index 724b0dc..0c00759 100644
+--- a/libavcodec/x86/ac3dsp.asm
++++ b/libavcodec/x86/ac3dsp.asm
+@@ -156,7 +156,7 @@ INIT_MMX mmx
+ %define ABS2 ABS2_MMX
+ AC3_MAX_MSB_ABS_INT16 or_abs
+ INIT_MMX mmx2
+-%define ABS2 ABS2_MMX2
++%define ABS2 ABS2_MMXEXT
+ AC3_MAX_MSB_ABS_INT16 min_max
+ INIT_XMM sse2
+ AC3_MAX_MSB_ABS_INT16 min_max
+diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
+index 5350f7e..b628f08 100644
+--- a/libavcodec/x86/cavsdsp.c
++++ b/libavcodec/x86/cavsdsp.c
+@@ -430,7 +430,7 @@ static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, ui
+ "mov" #size " " #b ", " #temp " \n\t"\
+ "pavgusb " #temp ", " #a " \n\t"\
+ "mov" #size " " #a ", " #b " \n\t"
+-#define AVG_MMX2_OP(a,b,temp, size) \
++#define AVG_MMXEXT_OP(a, b, temp, size) \
+ "mov" #size " " #b ", " #temp " \n\t"\
+ "pavgb " #temp ", " #a " \n\t"\
+ "mov" #size " " #a ", " #b " \n\t"
+@@ -439,7 +439,7 @@ static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, ui
+
+ #if HAVE_MMXEXT_INLINE
+ QPEL_CAVS(put_, PUT_OP, mmx2)
+-QPEL_CAVS(avg_, AVG_MMX2_OP, mmx2)
++QPEL_CAVS(avg_,AVG_MMXEXT_OP, mmx2)
+
+ CAVS_MC(put_, 8, mmx2)
+ CAVS_MC(put_, 16,mmx2)
+diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
+index ef843b5..1e78c20 100644
+--- a/libavcodec/x86/dsputil_mmx.c
++++ b/libavcodec/x86/dsputil_mmx.c
+@@ -923,7 +923,7 @@ static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
+ "packuswb %%mm5, %%mm5 \n\t" \
+ OP(%%mm5, out, %%mm7, d)
+
+-#define QPEL_BASE(OPNAME, ROUNDER, RND, OP_MMX2, OP_3DNOW) \
++#define QPEL_BASE(OPNAME, ROUNDER, RND, OP_MMXEXT, OP_3DNOW) \
+ static void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, \
+ uint8_t *src, \
+ int dstStride, \
+@@ -991,7 +991,7 @@ static void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, \
+ "psraw $5, %%mm3 \n\t" \
+ "movq %5, %%mm1 \n\t" \
+ "packuswb %%mm3, %%mm1 \n\t" \
+- OP_MMX2(%%mm1, (%1), %%mm4, q) \
++ OP_MMXEXT(%%mm1, (%1), %%mm4, q) \
+ /* mm0 = GHIJ, mm2 = FGHI, mm5 = HIJK, mm6 = IJKL, mm7 = 0 */ \
+ \
+ "movq 9(%0), %%mm1 \n\t" /* JKLMNOPQ */ \
+@@ -1038,7 +1038,7 @@ static void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, \
+ "paddw %%mm3, %%mm4 \n\t" /* 20a - 6b + 3c - d */ \
+ "psraw $5, %%mm4 \n\t" \
+ "packuswb %%mm4, %%mm0 \n\t" \
+- OP_MMX2(%%mm0, 8(%1), %%mm4, q) \
++ OP_MMXEXT(%%mm0, 8(%1), %%mm4, q) \
+ \
+ "add %3, %0 \n\t" \
+ "add %4, %1 \n\t" \
+@@ -1175,7 +1175,7 @@ static void OPNAME ## mpeg4_qpel8_h_lowpass_mmx2(uint8_t *dst, \
+ "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b + 3c - d */ \
+ "psraw $5, %%mm3 \n\t" \
+ "packuswb %%mm3, %%mm0 \n\t" \
+- OP_MMX2(%%mm0, (%1), %%mm4, q) \
++ OP_MMXEXT(%%mm0, (%1), %%mm4, q) \
+ \
+ "add %3, %0 \n\t" \
+ "add %4, %1 \n\t" \
+@@ -1744,19 +1744,19 @@ static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, \
+ "pavgusb "#temp", "#a" \n\t" \
+ "mov"#size" "#a", "#b" \n\t"
+
+-#define AVG_MMX2_OP(a, b, temp, size) \
++#define AVG_MMXEXT_OP(a, b, temp, size) \
+ "mov"#size" "#b", "#temp" \n\t" \
+ "pavgb "#temp", "#a" \n\t" \
+ "mov"#size" "#a", "#b" \n\t"
+
+ QPEL_BASE(put_, ff_pw_16, _, PUT_OP, PUT_OP)
+-QPEL_BASE(avg_, ff_pw_16, _, AVG_MMX2_OP, AVG_3DNOW_OP)
++QPEL_BASE(avg_, ff_pw_16, _, AVG_MMXEXT_OP, AVG_3DNOW_OP)
+ QPEL_BASE(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, PUT_OP)
+ QPEL_OP(put_, ff_pw_16, _, PUT_OP, 3dnow)
+ QPEL_OP(avg_, ff_pw_16, _, AVG_3DNOW_OP, 3dnow)
+ QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, 3dnow)
+ QPEL_OP(put_, ff_pw_16, _, PUT_OP, mmx2)
+-QPEL_OP(avg_, ff_pw_16, _, AVG_MMX2_OP, mmx2)
++QPEL_OP(avg_, ff_pw_16, _, AVG_MMXEXT_OP, mmx2)
+ QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmx2)
+
+ /***********************************/
+diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm
+index 597f894..6c4fb50 100644
+--- a/libavcodec/x86/dsputilenc.asm
++++ b/libavcodec/x86/dsputilenc.asm
+@@ -112,7 +112,7 @@ SECTION .text
+ movd %3, %1
+ %endmacro
+
+-%macro HSUM_MMX2 3
++%macro HSUM_MMXEXT 3
+ pshufw %2, %1, 0xE
+ paddusw %1, %2
+ pshufw %2, %1, 0x1
+@@ -263,12 +263,12 @@ INIT_MMX
+ %define HSUM HSUM_MMX
+ HADAMARD8_DIFF_MMX mmx
+
+-%define ABS1 ABS1_MMX2
+-%define HSUM HSUM_MMX2
++%define ABS1 ABS1_MMXEXT
++%define HSUM HSUM_MMXEXT
+ HADAMARD8_DIFF_MMX mmx2
+
+ INIT_XMM
+-%define ABS2 ABS2_MMX2
++%define ABS2 ABS2_MMXEXT
+ %if ARCH_X86_64
+ %define ABS_SUM_8x8 ABS_SUM_8x8_64
+ %else
+diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c
+index b7d88f0..43940bd 100644
+--- a/libavcodec/x86/dsputilenc_mmx.c
++++ b/libavcodec/x86/dsputilenc_mmx.c
+@@ -888,7 +888,7 @@ static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *src1, c
+ "pxor " #z ", " #a " \n\t"\
+ "psubw " #z ", " #a " \n\t"
+
+-#define MMABS_MMX2(a,z)\
++#define MMABS_MMXEXT(a, z) \
+ "pxor " #z ", " #z " \n\t"\
+ "psubw " #a ", " #z " \n\t"\
+ "pmaxsw " #z ", " #a " \n\t"
+@@ -912,7 +912,7 @@ static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *src1, c
+ "paddusw "#t", "#a" \n\t"\
+ "movd "#a", "#dst" \n\t"\
+
+-#define HSUM_MMX2(a, t, dst)\
++#define HSUM_MMXEXT(a, t, dst) \
+ "pshufw $0x0E, "#a", "#t" \n\t"\
+ "paddusw "#t", "#a" \n\t"\
+ "pshufw $0x01, "#a", "#t" \n\t"\
+@@ -974,8 +974,8 @@ DCT_SAD_FUNC(mmx)
+ #undef MMABS
+ #undef HSUM
+
+-#define HSUM(a,t,dst) HSUM_MMX2(a,t,dst)
+-#define MMABS(a,z) MMABS_MMX2(a,z)
++#define HSUM(a,t,dst) HSUM_MMXEXT(a,t,dst)
++#define MMABS(a,z) MMABS_MMXEXT(a,z)
+ DCT_SAD_FUNC(mmx2)
+ #undef HSUM
+ #undef DCT_SAD
+diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm
+index 5d861d3..5e779cb 100644
+--- a/libavcodec/x86/h264_idct.asm
++++ b/libavcodec/x86/h264_idct.asm
+@@ -246,7 +246,7 @@ cglobal h264_idct8_add_8_sse2, 3, 4, 10
+ IDCT8_ADD_SSE r0, r1, r2, r3
+ RET
+
+-%macro DC_ADD_MMX2_INIT 2-3
++%macro DC_ADD_MMXEXT_INIT 2-3
+ %if %0 == 2
+ movsx %1, word [%1]
+ add %1, 32
+@@ -266,7 +266,7 @@ cglobal h264_idct8_add_8_sse2, 3, 4, 10
+ packuswb m1, m1
+ %endmacro
+
+-%macro DC_ADD_MMX2_OP 4
++%macro DC_ADD_MMXEXT_OP 4
+ %1 m2, [%2 ]
+ %1 m3, [%2+%3 ]
+ %1 m4, [%2+%3*2]
+@@ -288,16 +288,16 @@ cglobal h264_idct8_add_8_sse2, 3, 4, 10
+ INIT_MMX
+ ; ff_h264_idct_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)
+ cglobal h264_idct_dc_add_8_mmx2, 3, 3, 0
+- DC_ADD_MMX2_INIT r1, r2
+- DC_ADD_MMX2_OP movh, r0, r2, r1
++ DC_ADD_MMXEXT_INIT r1, r2
++ DC_ADD_MMXEXT_OP movh, r0, r2, r1
+ RET
+
+ ; ff_h264_idct8_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)
+ cglobal h264_idct8_dc_add_8_mmx2, 3, 3, 0
+- DC_ADD_MMX2_INIT r1, r2
+- DC_ADD_MMX2_OP mova, r0, r2, r1
++ DC_ADD_MMXEXT_INIT r1, r2
++ DC_ADD_MMXEXT_OP mova, r0, r2, r1
+ lea r0, [r0+r2*4]
+- DC_ADD_MMX2_OP mova, r0, r2, r1
++ DC_ADD_MMXEXT_OP mova, r0, r2, r1
+ RET
+
+ ; ff_h264_idct_add16_mmx(uint8_t *dst, const int *block_offset,
+@@ -371,14 +371,14 @@ cglobal h264_idct_add16_8_mmx2, 5, 8 + npicregs, 0, dst1, block_offset, block, s
+ movsx r6, word [r2]
+ test r6, r6
+ jz .no_dc
+- DC_ADD_MMX2_INIT r2, r3, r6
++ DC_ADD_MMXEXT_INIT r2, r3, r6
+ %if ARCH_X86_64 == 0
+ %define dst2q r1
+ %define dst2d r1d
+ %endif
+ mov dst2d, dword [r1+r5*4]
+ lea dst2q, [r0+dst2q]
+- DC_ADD_MMX2_OP movh, dst2q, r3, r6
++ DC_ADD_MMXEXT_OP movh, dst2q, r3, r6
+ %if ARCH_X86_64 == 0
+ mov r1, r1m
+ %endif
+@@ -445,14 +445,14 @@ cglobal h264_idct_add16intra_8_mmx2, 5, 8 + npicregs, 0, dst1, block_offset, blo
+ movsx r6, word [r2]
+ test r6, r6
+ jz .skipblock
+- DC_ADD_MMX2_INIT r2, r3, r6
++ DC_ADD_MMXEXT_INIT r2, r3, r6
+ %if ARCH_X86_64 == 0
+ %define dst2q r1
+ %define dst2d r1d
+ %endif
+ mov dst2d, dword [r1+r5*4]
+ add dst2q, r0
+- DC_ADD_MMX2_OP movh, dst2q, r3, r6
++ DC_ADD_MMXEXT_OP movh, dst2q, r3, r6
+ %if ARCH_X86_64 == 0
+ mov r1, r1m
+ %endif
+@@ -483,16 +483,16 @@ cglobal h264_idct8_add4_8_mmx2, 5, 8 + npicregs, 0, dst1, block_offset, block, s
+ movsx r6, word [r2]
+ test r6, r6
+ jz .no_dc
+- DC_ADD_MMX2_INIT r2, r3, r6
++ DC_ADD_MMXEXT_INIT r2, r3, r6
+ %if ARCH_X86_64 == 0
+ %define dst2q r1
+ %define dst2d r1d
+ %endif
+ mov dst2d, dword [r1+r5*4]
+ lea dst2q, [r0+dst2q]
+- DC_ADD_MMX2_OP mova, dst2q, r3, r6
++ DC_ADD_MMXEXT_OP mova, dst2q, r3, r6
+ lea dst2q, [dst2q+r3*4]
+- DC_ADD_MMX2_OP mova, dst2q, r3, r6
++ DC_ADD_MMXEXT_OP mova, dst2q, r3, r6
+ %if ARCH_X86_64 == 0
+ mov r1, r1m
+ %endif
+@@ -541,16 +541,16 @@ cglobal h264_idct8_add4_8_sse2, 5, 8 + npicregs, 10, dst1, block_offset, block,
+ test r6, r6
+ jz .no_dc
+ INIT_MMX
+- DC_ADD_MMX2_INIT r2, r3, r6
++ DC_ADD_MMXEXT_INIT r2, r3, r6
+ %if ARCH_X86_64 == 0
+ %define dst2q r1
+ %define dst2d r1d
+ %endif
+ mov dst2d, dword [r1+r5*4]
+ add dst2q, r0
+- DC_ADD_MMX2_OP mova, dst2q, r3, r6
++ DC_ADD_MMXEXT_OP mova, dst2q, r3, r6
+ lea dst2q, [dst2q+r3*4]
+- DC_ADD_MMX2_OP mova, dst2q, r3, r6
++ DC_ADD_MMXEXT_OP mova, dst2q, r3, r6
+ %if ARCH_X86_64 == 0
+ mov r1, r1m
+ %endif
+@@ -644,7 +644,7 @@ h264_idct_add8_mmx2_plane:
+ movsx r6, word [r2]
+ test r6, r6
+ jz .skipblock
+- DC_ADD_MMX2_INIT r2, r3, r6
++ DC_ADD_MMXEXT_INIT r2, r3, r6
+ %if ARCH_X86_64
+ mov r0d, dword [r1+r5*4]
+ add r0, [dst2q]
+@@ -653,7 +653,7 @@ h264_idct_add8_mmx2_plane:
+ mov r0, [r0]
+ add r0, dword [r1+r5*4]
+ %endif
+- DC_ADD_MMX2_OP movh, r0, r3, r6
++ DC_ADD_MMXEXT_OP movh, r0, r3, r6
+ .skipblock:
+ inc r5
+ add r2, 32
+@@ -697,7 +697,7 @@ h264_idct_dc_add8_mmx2:
+ pshufw m1, m0, 0xFA ; -d-d-d-d-D-D-D-D
+ punpcklwd m0, m0 ; d d d d D D D D
+ lea r6, [r3*3]
+- DC_ADD_MMX2_OP movq, r0, r3, r6
++ DC_ADD_MMXEXT_OP movq, r0, r3, r6
+ ret
+
+ ALIGN 16
+diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c
+index 284c85a..5a2db78 100644
+--- a/libavcodec/x86/h264_qpel.c
++++ b/libavcodec/x86/h264_qpel.c
+@@ -1169,18 +1169,18 @@ QPEL_H264(avg_, AVG_3DNOW_OP, 3dnow)
+ #undef PAVGB
+ #define PAVGB "pavgb"
+ QPEL_H264(put_, PUT_OP, mmx2)
+-QPEL_H264(avg_, AVG_MMX2_OP, mmx2)
++QPEL_H264(avg_,AVG_MMXEXT_OP, mmx2)
+ QPEL_H264_V_XMM(put_, PUT_OP, sse2)
+-QPEL_H264_V_XMM(avg_, AVG_MMX2_OP, sse2)
++QPEL_H264_V_XMM(avg_,AVG_MMXEXT_OP, sse2)
+ QPEL_H264_HV_XMM(put_, PUT_OP, sse2)
+-QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, sse2)
++QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, sse2)
+ #if HAVE_SSSE3_INLINE
+ QPEL_H264_H_XMM(put_, PUT_OP, ssse3)
+-QPEL_H264_H_XMM(avg_, AVG_MMX2_OP, ssse3)
++QPEL_H264_H_XMM(avg_,AVG_MMXEXT_OP, ssse3)
+ QPEL_H264_HV2_XMM(put_, PUT_OP, ssse3)
+-QPEL_H264_HV2_XMM(avg_, AVG_MMX2_OP, ssse3)
++QPEL_H264_HV2_XMM(avg_,AVG_MMXEXT_OP, ssse3)
+ QPEL_H264_HV_XMM(put_, PUT_OP, ssse3)
+-QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, ssse3)
++QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, ssse3)
+ #endif
+ #undef PAVGB
+
+diff --git a/libavcodec/x86/vc1dsp.asm b/libavcodec/x86/vc1dsp.asm
+index e759cf5..ab15f7b 100644
+--- a/libavcodec/x86/vc1dsp.asm
++++ b/libavcodec/x86/vc1dsp.asm
+@@ -268,7 +268,7 @@ cglobal vc1_h_loop_filter8_%1, 3,5,0
+ RET
+ %endmacro
+
+-%define PABSW PABSW_MMX2
++%define PABSW PABSW_MMXEXT
+ VC1_LF_MMX mmx2
+
+ INIT_XMM
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index 3aac639..d7ec594 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -157,7 +157,7 @@
+ psubw %1, %2
+ %endmacro
+
+-%macro PABSW_MMX2 2
++%macro PABSW_MMXEXT 2
+ pxor %1, %1
+ psubw %1, %2
+ pmaxsw %1, %2
+@@ -189,13 +189,13 @@
+ psubw %2, %4
+ %endmacro
+
+-%macro ABS1_MMX2 2 ; a, tmp
++%macro ABS1_MMXEXT 2 ; a, tmp
+ pxor %2, %2
+ psubw %2, %1
+ pmaxsw %1, %2
+ %endmacro
+
+-%macro ABS2_MMX2 4 ; a, b, tmp0, tmp1
++%macro ABS2_MMXEXT 4 ; a, b, tmp0, tmp1
+ pxor %3, %3
+ pxor %4, %4
+ psubw %3, %1
+diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
+index d7a2fdb..d89a26f 100644
+--- a/libswscale/x86/swscale_template.c
++++ b/libswscale/x86/swscale_template.c
+@@ -519,7 +519,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
+ "cmp "#dstw", "#index" \n\t"\
+ " jb 1b \n\t"
+
+-#define WRITEBGR24MMX2(dst, dstw, index) \
++#define WRITEBGR24MMXEXT(dst, dstw, index) \
+ /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\
+ "movq "MANGLE(ff_M24A)", %%mm0 \n\t"\
+ "movq "MANGLE(ff_M24C)", %%mm7 \n\t"\
+@@ -569,7 +569,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
+
+ #if COMPILE_TEMPLATE_MMXEXT
+ #undef WRITEBGR24
+-#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX2(dst, dstw, index)
++#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMXEXT(dst, dstw, index)
+ #else
+ #undef WRITEBGR24
+ #define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX(dst, dstw, index)
+@@ -1411,7 +1411,7 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
+ PREFETCH" 64(%%"REG_c") \n\t"
+
+ #if ARCH_X86_64
+-#define CALL_MMX2_FILTER_CODE \
++#define CALL_MMXEXT_FILTER_CODE \
+ "movl (%%"REG_b"), %%esi \n\t"\
+ "call *%4 \n\t"\
+ "movl (%%"REG_b", %%"REG_a"), %%esi \n\t"\
+@@ -1420,7 +1420,7 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
+ "xor %%"REG_a", %%"REG_a" \n\t"\
+
+ #else
+-#define CALL_MMX2_FILTER_CODE \
++#define CALL_MMXEXT_FILTER_CODE \
+ "movl (%%"REG_b"), %%esi \n\t"\
+ "call *%4 \n\t"\
+ "addl (%%"REG_b", %%"REG_a"), %%"REG_c" \n\t"\
+@@ -1429,14 +1429,14 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
+
+ #endif /* ARCH_X86_64 */
+
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
+
+ #if defined(PIC)
+ "mov %5, %%"REG_b" \n\t"
+@@ -1506,10 +1506,10 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
+ PREFETCH" 32(%%"REG_c") \n\t"
+ PREFETCH" 64(%%"REG_c") \n\t"
+
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
+ "xor %%"REG_a", %%"REG_a" \n\t" // i
+ "mov %5, %%"REG_c" \n\t" // src
+ "mov %6, %%"REG_D" \n\t" // buf2
+@@ -1517,10 +1517,10 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
+ PREFETCH" 32(%%"REG_c") \n\t"
+ PREFETCH" 64(%%"REG_c") \n\t"
+
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
+- CALL_MMX2_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
++ CALL_MMXEXT_FILTER_CODE
+
+ #if defined(PIC)
+ "mov %7, %%"REG_b" \n\t"
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0095-x86-fmtconvert-port-to-cpuflags.patch b/debian/patches/post-9beta2/0095-x86-fmtconvert-port-to-cpuflags.patch
new file mode 100644
index 0000000..3cc04f2
--- /dev/null
+++ b/debian/patches/post-9beta2/0095-x86-fmtconvert-port-to-cpuflags.patch
@@ -0,0 +1,326 @@
+From be923ed659016350592acb9b3346f706f8170ac5 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 15 Jul 2012 15:42:17 +0200
+Subject: [PATCH 095/204] x86: fmtconvert: port to cpuflags
+
+---
+ libavcodec/x86/fmtconvert.asm | 141 +++++++++++++++++++++--------------------
+ 1 file changed, 71 insertions(+), 70 deletions(-)
+
+diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm
+index 2951b16..969f9ab 100644
+--- a/libavcodec/x86/fmtconvert.asm
++++ b/libavcodec/x86/fmtconvert.asm
+@@ -26,11 +26,11 @@ SECTION_TEXT
+ ;---------------------------------------------------------------------------------
+ ; void int32_to_float_fmul_scalar(float *dst, const int *src, float mul, int len);
+ ;---------------------------------------------------------------------------------
+-%macro INT32_TO_FLOAT_FMUL_SCALAR 2
++%macro INT32_TO_FLOAT_FMUL_SCALAR 1
+ %if UNIX64
+-cglobal int32_to_float_fmul_scalar_%1, 3,3,%2, dst, src, len
++cglobal int32_to_float_fmul_scalar, 3, 3, %1, dst, src, len
+ %else
+-cglobal int32_to_float_fmul_scalar_%1, 4,4,%2, dst, src, mul, len
++cglobal int32_to_float_fmul_scalar, 4, 4, %1, dst, src, mul, len
+ %endif
+ %if WIN64
+ SWAP 0, 2
+@@ -43,7 +43,7 @@ cglobal int32_to_float_fmul_scalar_%1, 4,4,%2, dst, src, mul, len
+ add dstq, lenq
+ neg lenq
+ .loop:
+-%ifidn %1, sse2
++%if cpuflag(sse2)
+ cvtdq2ps m1, [srcq+lenq ]
+ cvtdq2ps m2, [srcq+lenq+16]
+ %else
+@@ -63,27 +63,26 @@ cglobal int32_to_float_fmul_scalar_%1, 4,4,%2, dst, src, mul, len
+ REP_RET
+ %endmacro
+
+-INIT_XMM
++INIT_XMM sse
+ %define SPLATD SPLATD_SSE
+-%define movdqa movaps
+-INT32_TO_FLOAT_FMUL_SCALAR sse, 5
+-%undef movdqa
++INT32_TO_FLOAT_FMUL_SCALAR 5
++INIT_XMM sse2
+ %define SPLATD SPLATD_SSE2
+-INT32_TO_FLOAT_FMUL_SCALAR sse2, 3
++INT32_TO_FLOAT_FMUL_SCALAR 3
+ %undef SPLATD
+
+
+ ;------------------------------------------------------------------------------
+ ; void ff_float_to_int16(int16_t *dst, const float *src, long len);
+ ;------------------------------------------------------------------------------
+-%macro FLOAT_TO_INT16 2
+-cglobal float_to_int16_%1, 3,3,%2, dst, src, len
++%macro FLOAT_TO_INT16 1
++cglobal float_to_int16, 3, 3, %1, dst, src, len
+ add lenq, lenq
+ lea srcq, [srcq+2*lenq]
+ add dstq, lenq
+ neg lenq
+ .loop:
+-%ifidn %1, sse2
++%if cpuflag(sse2)
+ cvtps2dq m0, [srcq+2*lenq ]
+ cvtps2dq m1, [srcq+2*lenq+16]
+ packssdw m0, m1
+@@ -100,31 +99,32 @@ cglobal float_to_int16_%1, 3,3,%2, dst, src, len
+ %endif
+ add lenq, 16
+ js .loop
+-%ifnidn %1, sse2
++%if mmsize == 8
+ emms
+ %endif
+ REP_RET
+ %endmacro
+
+-INIT_XMM
+-FLOAT_TO_INT16 sse2, 2
+-INIT_MMX
+-FLOAT_TO_INT16 sse, 0
++INIT_XMM sse2
++FLOAT_TO_INT16 2
++INIT_MMX sse
++FLOAT_TO_INT16 0
+ %define cvtps2pi pf2id
+-FLOAT_TO_INT16 3dnow, 0
++INIT_MMX 3dnow
++FLOAT_TO_INT16 0
+ %undef cvtps2pi
+
+ ;------------------------------------------------------------------------------
+ ; void ff_float_to_int16_step(int16_t *dst, const float *src, long len, long step);
+ ;------------------------------------------------------------------------------
+-%macro FLOAT_TO_INT16_STEP 2
+-cglobal float_to_int16_step_%1, 4,7,%2, dst, src, len, step, step3, v1, v2
++%macro FLOAT_TO_INT16_STEP 1
++cglobal float_to_int16_step, 4, 7, %1, dst, src, len, step, step3, v1, v2
+ add lenq, lenq
+ lea srcq, [srcq+2*lenq]
+ lea step3q, [stepq*3]
+ neg lenq
+ .loop:
+-%ifidn %1, sse2
++%if cpuflag(sse2)
+ cvtps2dq m0, [srcq+2*lenq ]
+ cvtps2dq m1, [srcq+2*lenq+16]
+ packssdw m0, m1
+@@ -179,25 +179,26 @@ cglobal float_to_int16_step_%1, 4,7,%2, dst, src, len, step, step3, v1, v2
+ %endif
+ add lenq, 16
+ js .loop
+-%ifnidn %1, sse2
++%if mmsize == 8
+ emms
+ %endif
+ REP_RET
+ %endmacro
+
+-INIT_XMM
+-FLOAT_TO_INT16_STEP sse2, 2
+-INIT_MMX
+-FLOAT_TO_INT16_STEP sse, 0
++INIT_XMM sse2
++FLOAT_TO_INT16_STEP 2
++INIT_MMX sse
++FLOAT_TO_INT16_STEP 0
+ %define cvtps2pi pf2id
+-FLOAT_TO_INT16_STEP 3dnow, 0
++INIT_MMX 3dnow
++FLOAT_TO_INT16_STEP 0
+ %undef cvtps2pi
+
+ ;-------------------------------------------------------------------------------
+ ; void ff_float_to_int16_interleave2(int16_t *dst, const float **src, long len);
+ ;-------------------------------------------------------------------------------
+-%macro FLOAT_TO_INT16_INTERLEAVE2 1
+-cglobal float_to_int16_interleave2_%1, 3,4,2, dst, src0, src1, len
++%macro FLOAT_TO_INT16_INTERLEAVE2 0
++cglobal float_to_int16_interleave2, 3, 4, 2, dst, src0, src1, len
+ lea lenq, [4*r2q]
+ mov src1q, [src0q+gprsize]
+ mov src0q, [src0q]
+@@ -206,7 +207,7 @@ cglobal float_to_int16_interleave2_%1, 3,4,2, dst, src0, src1, len
+ add src1q, lenq
+ neg lenq
+ .loop:
+-%ifidn %1, sse2
++%if cpuflag(sse2)
+ cvtps2dq m0, [src0q+lenq]
+ cvtps2dq m1, [src1q+lenq]
+ packssdw m0, m1
+@@ -228,21 +229,20 @@ cglobal float_to_int16_interleave2_%1, 3,4,2, dst, src0, src1, len
+ %endif
+ add lenq, 16
+ js .loop
+-%ifnidn %1, sse2
++%if mmsize == 8
+ emms
+ %endif
+ REP_RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX 3dnow
+ %define cvtps2pi pf2id
+-FLOAT_TO_INT16_INTERLEAVE2 3dnow
++FLOAT_TO_INT16_INTERLEAVE2
+ %undef cvtps2pi
+-%define movdqa movaps
+-FLOAT_TO_INT16_INTERLEAVE2 sse
+-%undef movdqa
+-INIT_XMM
+-FLOAT_TO_INT16_INTERLEAVE2 sse2
++INIT_MMX sse
++FLOAT_TO_INT16_INTERLEAVE2
++INIT_XMM sse2
++FLOAT_TO_INT16_INTERLEAVE2
+
+
+ %macro PSWAPD_SSE 2
+@@ -254,9 +254,9 @@ FLOAT_TO_INT16_INTERLEAVE2 sse2
+ punpckldq %1, %2
+ %endmacro
+
+-%macro FLOAT_TO_INT16_INTERLEAVE6 1
++%macro FLOAT_TO_INT16_INTERLEAVE6 0
+ ; void float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len)
+-cglobal float_to_int16_interleave6_%1, 2,8,0, dst, src, src1, src2, src3, src4, src5, len
++cglobal float_to_int16_interleave6, 2, 8, 0, dst, src, src1, src2, src3, src4, src5, len
+ %if ARCH_X86_64
+ mov lend, r2d
+ %else
+@@ -302,21 +302,24 @@ cglobal float_to_int16_interleave6_%1, 2,8,0, dst, src, src1, src2, src3, src4,
+ RET
+ %endmacro ; FLOAT_TO_INT16_INTERLEAVE6
+
++INIT_MMX sse
+ %define pswapd PSWAPD_SSE
+-FLOAT_TO_INT16_INTERLEAVE6 sse
++FLOAT_TO_INT16_INTERLEAVE6
++INIT_MMX 3dnow
+ %define cvtps2pi pf2id
+ %define pswapd PSWAPD_3DNOW
+-FLOAT_TO_INT16_INTERLEAVE6 3dnow
++FLOAT_TO_INT16_INTERLEAVE6
+ %undef pswapd
+-FLOAT_TO_INT16_INTERLEAVE6 3dnowext
++INIT_MMX 3dnowext
++FLOAT_TO_INT16_INTERLEAVE6
+ %undef cvtps2pi
+
+ ;-----------------------------------------------------------------------------
+ ; void ff_float_interleave6(float *dst, const float **src, unsigned int len);
+ ;-----------------------------------------------------------------------------
+
+-%macro FLOAT_INTERLEAVE6 2
+-cglobal float_interleave6_%1, 2,8,%2, dst, src, src1, src2, src3, src4, src5, len
++%macro FLOAT_INTERLEAVE6 1
++cglobal float_interleave6, 2, 8, %1, dst, src, src1, src2, src3, src4, src5, len
+ %if ARCH_X86_64
+ mov lend, r2d
+ %else
+@@ -334,7 +337,7 @@ cglobal float_interleave6_%1, 2,8,%2, dst, src, src1, src2, src3, src4, src5, le
+ sub src4q, srcq
+ sub src5q, srcq
+ .loop:
+-%ifidn %1, sse
++%if cpuflag(sse)
+ movaps m0, [srcq]
+ movaps m1, [srcq+src1q]
+ movaps m2, [srcq+src2q]
+@@ -383,62 +386,60 @@ cglobal float_interleave6_%1, 2,8,%2, dst, src, src1, src2, src3, src4, src5, le
+ add dstq, mmsize*6
+ sub lend, mmsize/4
+ jg .loop
+-%ifidn %1, mmx
++%if mmsize == 8
+ emms
+ %endif
+ REP_RET
+ %endmacro
+
+-INIT_MMX
+-FLOAT_INTERLEAVE6 mmx, 0
+-INIT_XMM
+-FLOAT_INTERLEAVE6 sse, 7
++INIT_MMX mmx
++FLOAT_INTERLEAVE6 0
++INIT_XMM sse
++FLOAT_INTERLEAVE6 7
+
+ ;-----------------------------------------------------------------------------
+ ; void ff_float_interleave2(float *dst, const float **src, unsigned int len);
+ ;-----------------------------------------------------------------------------
+
+-%macro FLOAT_INTERLEAVE2 2
+-cglobal float_interleave2_%1, 3,4,%2, dst, src, len, src1
++%macro FLOAT_INTERLEAVE2 1
++cglobal float_interleave2, 3, 4, %1, dst, src, len, src1
+ mov src1q, [srcq+gprsize]
+ mov srcq, [srcq ]
+ sub src1q, srcq
+ .loop:
+- MOVPS m0, [srcq ]
+- MOVPS m1, [srcq+src1q ]
+- MOVPS m3, [srcq +mmsize]
+- MOVPS m4, [srcq+src1q+mmsize]
++ mova m0, [srcq ]
++ mova m1, [srcq+src1q ]
++ mova m3, [srcq +mmsize]
++ mova m4, [srcq+src1q+mmsize]
+
+- MOVPS m2, m0
++ mova m2, m0
+ PUNPCKLDQ m0, m1
+ PUNPCKHDQ m2, m1
+
+- MOVPS m1, m3
++ mova m1, m3
+ PUNPCKLDQ m3, m4
+ PUNPCKHDQ m1, m4
+
+- MOVPS [dstq ], m0
+- MOVPS [dstq+1*mmsize], m2
+- MOVPS [dstq+2*mmsize], m3
+- MOVPS [dstq+3*mmsize], m1
++ mova [dstq ], m0
++ mova [dstq+1*mmsize], m2
++ mova [dstq+2*mmsize], m3
++ mova [dstq+3*mmsize], m1
+
+ add srcq, mmsize*2
+ add dstq, mmsize*4
+ sub lend, mmsize/2
+ jg .loop
+-%ifidn %1, mmx
++%if mmsize == 8
+ emms
+ %endif
+ REP_RET
+ %endmacro
+
+-INIT_MMX
+-%define MOVPS movq
++INIT_MMX mmx
+ %define PUNPCKLDQ punpckldq
+ %define PUNPCKHDQ punpckhdq
+-FLOAT_INTERLEAVE2 mmx, 0
+-INIT_XMM
+-%define MOVPS movaps
++FLOAT_INTERLEAVE2 0
++INIT_XMM sse
+ %define PUNPCKLDQ unpcklps
+ %define PUNPCKHDQ unpckhps
+-FLOAT_INTERLEAVE2 sse, 5
++FLOAT_INTERLEAVE2 5
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0096-x86-fmtconvert-Refactor-cvtps2pi-emulation-through-c.patch b/debian/patches/post-9beta2/0096-x86-fmtconvert-Refactor-cvtps2pi-emulation-through-c.patch
new file mode 100644
index 0000000..0d39f6d
--- /dev/null
+++ b/debian/patches/post-9beta2/0096-x86-fmtconvert-Refactor-cvtps2pi-emulation-through-c.patch
@@ -0,0 +1,142 @@
+From be2c456e962ab0a748164e0e43d0d74cc0d704fa Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 15 Jul 2012 19:55:21 +0200
+Subject: [PATCH 096/204] x86: fmtconvert: Refactor cvtps2pi emulation through
+ cpuflags
+
+---
+ libavcodec/x86/fmtconvert.asm | 52 ++++++++++++++++++++---------------------
+ 1 file changed, 26 insertions(+), 26 deletions(-)
+
+diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm
+index 969f9ab..fb183ce 100644
+--- a/libavcodec/x86/fmtconvert.asm
++++ b/libavcodec/x86/fmtconvert.asm
+@@ -23,6 +23,14 @@
+
+ SECTION_TEXT
+
++%macro CVTPS2PI 2
++%if cpuflag(sse)
++ cvtps2pi %1, %2
++%elif cpuflag(3dnow)
++ pf2id %1, %2
++%endif
++%endmacro
++
+ ;---------------------------------------------------------------------------------
+ ; void int32_to_float_fmul_scalar(float *dst, const int *src, float mul, int len);
+ ;---------------------------------------------------------------------------------
+@@ -88,10 +96,10 @@ cglobal float_to_int16, 3, 3, %1, dst, src, len
+ packssdw m0, m1
+ mova [dstq+lenq], m0
+ %else
+- cvtps2pi m0, [srcq+2*lenq ]
+- cvtps2pi m1, [srcq+2*lenq+ 8]
+- cvtps2pi m2, [srcq+2*lenq+16]
+- cvtps2pi m3, [srcq+2*lenq+24]
++ CVTPS2PI m0, [srcq+2*lenq ]
++ CVTPS2PI m1, [srcq+2*lenq+ 8]
++ CVTPS2PI m2, [srcq+2*lenq+16]
++ CVTPS2PI m3, [srcq+2*lenq+24]
+ packssdw m0, m1
+ packssdw m2, m3
+ mova [dstq+lenq ], m0
+@@ -109,10 +117,8 @@ INIT_XMM sse2
+ FLOAT_TO_INT16 2
+ INIT_MMX sse
+ FLOAT_TO_INT16 0
+-%define cvtps2pi pf2id
+ INIT_MMX 3dnow
+ FLOAT_TO_INT16 0
+-%undef cvtps2pi
+
+ ;------------------------------------------------------------------------------
+ ; void ff_float_to_int16_step(int16_t *dst, const float *src, long len, long step);
+@@ -150,10 +156,10 @@ cglobal float_to_int16_step, 4, 7, %1, dst, src, len, step, step3, v1, v2
+ mov [dstq+step3q*2], v2w
+ lea dstq, [dstq+stepq*8]
+ %else
+- cvtps2pi m0, [srcq+2*lenq ]
+- cvtps2pi m1, [srcq+2*lenq+ 8]
+- cvtps2pi m2, [srcq+2*lenq+16]
+- cvtps2pi m3, [srcq+2*lenq+24]
++ CVTPS2PI m0, [srcq+2*lenq ]
++ CVTPS2PI m1, [srcq+2*lenq+ 8]
++ CVTPS2PI m2, [srcq+2*lenq+16]
++ CVTPS2PI m3, [srcq+2*lenq+24]
+ packssdw m0, m1
+ packssdw m2, m3
+ movd v1d, m0
+@@ -189,10 +195,8 @@ INIT_XMM sse2
+ FLOAT_TO_INT16_STEP 2
+ INIT_MMX sse
+ FLOAT_TO_INT16_STEP 0
+-%define cvtps2pi pf2id
+ INIT_MMX 3dnow
+ FLOAT_TO_INT16_STEP 0
+-%undef cvtps2pi
+
+ ;-------------------------------------------------------------------------------
+ ; void ff_float_to_int16_interleave2(int16_t *dst, const float **src, long len);
+@@ -215,10 +219,10 @@ cglobal float_to_int16_interleave2, 3, 4, 2, dst, src0, src1, len
+ punpcklwd m0, m1
+ mova [dstq+lenq], m0
+ %else
+- cvtps2pi m0, [src0q+lenq ]
+- cvtps2pi m1, [src0q+lenq+8]
+- cvtps2pi m2, [src1q+lenq ]
+- cvtps2pi m3, [src1q+lenq+8]
++ CVTPS2PI m0, [src0q+lenq ]
++ CVTPS2PI m1, [src0q+lenq+8]
++ CVTPS2PI m2, [src1q+lenq ]
++ CVTPS2PI m3, [src1q+lenq+8]
+ packssdw m0, m1
+ packssdw m2, m3
+ mova m1, m0
+@@ -236,9 +240,7 @@ cglobal float_to_int16_interleave2, 3, 4, 2, dst, src0, src1, len
+ %endmacro
+
+ INIT_MMX 3dnow
+-%define cvtps2pi pf2id
+ FLOAT_TO_INT16_INTERLEAVE2
+-%undef cvtps2pi
+ INIT_MMX sse
+ FLOAT_TO_INT16_INTERLEAVE2
+ INIT_XMM sse2
+@@ -274,12 +276,12 @@ cglobal float_to_int16_interleave6, 2, 8, 0, dst, src, src1, src2, src3, src4, s
+ sub src4q, srcq
+ sub src5q, srcq
+ .loop:
+- cvtps2pi mm0, [srcq]
+- cvtps2pi mm1, [srcq+src1q]
+- cvtps2pi mm2, [srcq+src2q]
+- cvtps2pi mm3, [srcq+src3q]
+- cvtps2pi mm4, [srcq+src4q]
+- cvtps2pi mm5, [srcq+src5q]
++ CVTPS2PI mm0, [srcq]
++ CVTPS2PI mm1, [srcq+src1q]
++ CVTPS2PI mm2, [srcq+src2q]
++ CVTPS2PI mm3, [srcq+src3q]
++ CVTPS2PI mm4, [srcq+src4q]
++ CVTPS2PI mm5, [srcq+src5q]
+ packssdw mm0, mm3
+ packssdw mm1, mm4
+ packssdw mm2, mm5
+@@ -306,13 +308,11 @@ INIT_MMX sse
+ %define pswapd PSWAPD_SSE
+ FLOAT_TO_INT16_INTERLEAVE6
+ INIT_MMX 3dnow
+-%define cvtps2pi pf2id
+ %define pswapd PSWAPD_3DNOW
+ FLOAT_TO_INT16_INTERLEAVE6
+ %undef pswapd
+ INIT_MMX 3dnowext
+ FLOAT_TO_INT16_INTERLEAVE6
+-%undef cvtps2pi
+
+ ;-----------------------------------------------------------------------------
+ ; void ff_float_interleave6(float *dst, const float **src, unsigned int len);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0097-x86-Fix-assembly-with-NASM.patch b/debian/patches/post-9beta2/0097-x86-Fix-assembly-with-NASM.patch
new file mode 100644
index 0000000..f26433b
--- /dev/null
+++ b/debian/patches/post-9beta2/0097-x86-Fix-assembly-with-NASM.patch
@@ -0,0 +1,29 @@
+From 9c167914a1d88192882fe09dfce430a299580a8a Mon Sep 17 00:00:00 2001
+From: Dave Yeo <dave.r.yeo at gmail.com>
+Date: Tue, 30 Oct 2012 23:48:26 -0700
+Subject: [PATCH 097/204] x86: Fix assembly with NASM
+
+Unlike YASM, NASM only looks for include files in the current
+directory, not in the directory that included files reside in.
+
+Signed-off-by: Diego Biurrun <diego at biurrun.de>
+---
+ libavutil/x86/x86util.asm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index d7ec594..4c6f4c6 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -23,7 +23,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
+-%include "x86inc.asm"
++%include "libavutil/x86/x86inc.asm"
+
+ %macro SBUTTERFLY 4
+ %if avx_enabled == 0
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0098-aacdec-Drop-some-unused-function-arguments.patch b/debian/patches/post-9beta2/0098-aacdec-Drop-some-unused-function-arguments.patch
new file mode 100644
index 0000000..43de0c1
--- /dev/null
+++ b/debian/patches/post-9beta2/0098-aacdec-Drop-some-unused-function-arguments.patch
@@ -0,0 +1,205 @@
+From 5707af8d0b9c5a7e8a742a11798e406f99d78cea Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 19:15:54 +0200
+Subject: [PATCH 098/204] aacdec: Drop some unused function arguments
+
+---
+ libavcodec/aacdec.c | 44 ++++++++++++++++++++------------------------
+ 1 file changed, 20 insertions(+), 24 deletions(-)
+
+diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
+index b7caecb..59f39fd 100644
+--- a/libavcodec/aacdec.c
++++ b/libavcodec/aacdec.c
+@@ -171,7 +171,7 @@ struct elem_to_channel {
+ };
+
+ static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
+- uint8_t (*layout_map)[3], int offset, int tags, uint64_t left,
++ uint8_t (*layout_map)[3], int offset, uint64_t left,
+ uint64_t right, int pos)
+ {
+ if (layout_map[offset][0] == TYPE_CPE) {
+@@ -253,21 +253,21 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
+ num_front_channels--;
+ }
+ if (num_front_channels >= 4) {
+- i += assign_pair(e2c_vec, layout_map, i, tags,
++ i += assign_pair(e2c_vec, layout_map, i,
+ AV_CH_FRONT_LEFT_OF_CENTER,
+ AV_CH_FRONT_RIGHT_OF_CENTER,
+ AAC_CHANNEL_FRONT);
+ num_front_channels -= 2;
+ }
+ if (num_front_channels >= 2) {
+- i += assign_pair(e2c_vec, layout_map, i, tags,
++ i += assign_pair(e2c_vec, layout_map, i,
+ AV_CH_FRONT_LEFT,
+ AV_CH_FRONT_RIGHT,
+ AAC_CHANNEL_FRONT);
+ num_front_channels -= 2;
+ }
+ while (num_front_channels >= 2) {
+- i += assign_pair(e2c_vec, layout_map, i, tags,
++ i += assign_pair(e2c_vec, layout_map, i,
+ UINT64_MAX,
+ UINT64_MAX,
+ AAC_CHANNEL_FRONT);
+@@ -275,14 +275,14 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
+ }
+
+ if (num_side_channels >= 2) {
+- i += assign_pair(e2c_vec, layout_map, i, tags,
++ i += assign_pair(e2c_vec, layout_map, i,
+ AV_CH_SIDE_LEFT,
+ AV_CH_SIDE_RIGHT,
+ AAC_CHANNEL_FRONT);
+ num_side_channels -= 2;
+ }
+ while (num_side_channels >= 2) {
+- i += assign_pair(e2c_vec, layout_map, i, tags,
++ i += assign_pair(e2c_vec, layout_map, i,
+ UINT64_MAX,
+ UINT64_MAX,
+ AAC_CHANNEL_SIDE);
+@@ -290,14 +290,14 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
+ }
+
+ while (num_back_channels >= 4) {
+- i += assign_pair(e2c_vec, layout_map, i, tags,
++ i += assign_pair(e2c_vec, layout_map, i,
+ UINT64_MAX,
+ UINT64_MAX,
+ AAC_CHANNEL_BACK);
+ num_back_channels -= 2;
+ }
+ if (num_back_channels >= 2) {
+- i += assign_pair(e2c_vec, layout_map, i, tags,
++ i += assign_pair(e2c_vec, layout_map, i,
+ AV_CH_BACK_LEFT,
+ AV_CH_BACK_RIGHT,
+ AAC_CHANNEL_BACK);
+@@ -379,7 +379,7 @@ static void pop_output_configuration(AACContext *ac) {
+ */
+ static int output_configure(AACContext *ac,
+ uint8_t layout_map[MAX_ELEM_ID*4][3], int tags,
+- int channel_config, enum OCStatus oc_type)
++ enum OCStatus oc_type)
+ {
+ AVCodecContext *avctx = ac->avctx;
+ int i, channels = 0, ret;
+@@ -457,7 +457,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
+ 2) < 0)
+ return NULL;
+ if (output_configure(ac, layout_map, layout_map_tags,
+- 2, OC_TRIAL_FRAME) < 0)
++ OC_TRIAL_FRAME) < 0)
+ return NULL;
+
+ ac->oc[1].m4ac.chan_config = 2;
+@@ -473,7 +473,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
+ 1) < 0)
+ return NULL;
+ if (output_configure(ac, layout_map, layout_map_tags,
+- 1, OC_TRIAL_FRAME) < 0)
++ OC_TRIAL_FRAME) < 0)
+ return NULL;
+
+ ac->oc[1].m4ac.chan_config = 1;
+@@ -660,8 +660,7 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
+ } else if (m4ac->sbr == 1 && m4ac->ps == -1)
+ m4ac->ps = 1;
+
+- if (ac && (ret = output_configure(ac, layout_map, tags,
+- channel_config, OC_GLOBAL_HDR)))
++ if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR)))
+ return ret;
+
+ if (extension_flag) {
+@@ -837,7 +836,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
+ &layout_map_tags, ac->oc[1].m4ac.chan_config);
+ if (!ret)
+ output_configure(ac, layout_map, layout_map_tags,
+- ac->oc[1].m4ac.chan_config, OC_GLOBAL_HDR);
++ OC_GLOBAL_HDR);
+ else if (avctx->err_recognition & AV_EF_EXPLODE)
+ return AVERROR_INVALIDDATA;
+ }
+@@ -935,7 +934,7 @@ static int decode_prediction(AACContext *ac, IndividualChannelStream *ics,
+ /**
+ * Decode Long Term Prediction data; reference: table 4.xx.
+ */
+-static void decode_ltp(AACContext *ac, LongTermPrediction *ltp,
++static void decode_ltp(LongTermPrediction *ltp,
+ GetBitContext *gb, uint8_t max_sfb)
+ {
+ int sfb;
+@@ -996,7 +995,7 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
+ return AVERROR_INVALIDDATA;
+ } else {
+ if ((ics->ltp.present = get_bits(gb, 1)))
+- decode_ltp(ac, &ics->ltp, gb, ics->max_sfb);
++ decode_ltp(&ics->ltp, gb, ics->max_sfb);
+ }
+ }
+ }
+@@ -1734,7 +1733,7 @@ static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
+ cpe->ch[1].ics.use_kb_window[1] = i;
+ if (cpe->ch[1].ics.predictor_present && (ac->oc[1].m4ac.object_type != AOT_AAC_MAIN))
+ if ((cpe->ch[1].ics.ltp.present = get_bits(gb, 1)))
+- decode_ltp(ac, &cpe->ch[1].ics.ltp, gb, cpe->ch[1].ics.max_sfb);
++ decode_ltp(&cpe->ch[1].ics.ltp, gb, cpe->ch[1].ics.max_sfb);
+ ms_present = get_bits(gb, 2);
+ if (ms_present == 3) {
+ av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n");
+@@ -1861,12 +1860,10 @@ static int decode_drc_channel_exclusions(DynamicRangeControl *che_drc,
+ /**
+ * Decode dynamic range information; reference: table 4.52.
+ *
+- * @param cnt length of TYPE_FIL syntactic element in bytes
+- *
+ * @return Returns number of bytes consumed.
+ */
+ static int decode_dynamic_range(DynamicRangeControl *che_drc,
+- GetBitContext *gb, int cnt)
++ GetBitContext *gb)
+ {
+ int n = 1;
+ int drc_num_bands = 1;
+@@ -1943,14 +1940,14 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
+ ac->oc[1].m4ac.sbr = 1;
+ ac->oc[1].m4ac.ps = 1;
+ output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
+- ac->oc[1].m4ac.chan_config, ac->oc[1].status);
++ ac->oc[1].status);
+ } else {
+ ac->oc[1].m4ac.sbr = 1;
+ }
+ res = ff_decode_sbr_extension(ac, &che->sbr, gb, crc_flag, cnt, elem_type);
+ break;
+ case EXT_DYNAMIC_RANGE:
+- res = decode_dynamic_range(&ac->che_drc, gb, cnt);
++ res = decode_dynamic_range(&ac->che_drc, gb);
+ break;
+ case EXT_FILL:
+ case EXT_FILL_DATA:
+@@ -2333,7 +2330,6 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
+ &layout_map_tags, hdr_info.chan_config))
+ return -7;
+ if (output_configure(ac, layout_map, layout_map_tags,
+- hdr_info.chan_config,
+ FFMAX(ac->oc[1].status, OC_TRIAL_FRAME)))
+ return -7;
+ } else {
+@@ -2430,7 +2426,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
+ "Not evaluating a further program_config_element as this construct is dubious at best.\n");
+ pop_output_configuration(ac);
+ } else {
+- err = output_configure(ac, layout_map, tags, 0, OC_TRIAL_PCE);
++ err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE);
+ pce_found = 1;
+ }
+ break;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0099-swscale-do-not-forget-to-swap-data-in-formats-with-d.patch b/debian/patches/post-9beta2/0099-swscale-do-not-forget-to-swap-data-in-formats-with-d.patch
new file mode 100644
index 0000000..86af041
--- /dev/null
+++ b/debian/patches/post-9beta2/0099-swscale-do-not-forget-to-swap-data-in-formats-with-d.patch
@@ -0,0 +1,131 @@
+From 38fdf7258035eb520ca152e9bea6d95cdfaca424 Mon Sep 17 00:00:00 2001
+From: Kostya Shishkov <kostya.shishkov at gmail.com>
+Date: Wed, 31 Oct 2012 11:26:32 +0100
+Subject: [PATCH 099/204] swscale: do not forget to swap data in formats with
+ different endianness
+
+Otherwise during scaling it will try to interpret input in the wrong way and
+that leads to the test results disagreeing on different platforms and with
+different optimizations.
+
+Signed-off-by: Diego Biurrun <diego at biurrun.de>
+---
+ libswscale/input.c | 42 +++++++++++++++++++++++++++++++++++++++++
+ tests/ref/lavfi/pixfmts_scale | 16 ++++++++--------
+ 2 files changed, 50 insertions(+), 8 deletions(-)
+
+diff --git a/libswscale/input.c b/libswscale/input.c
+index 142cc29..2e8d43f 100644
+--- a/libswscale/input.c
++++ b/libswscale/input.c
+@@ -724,6 +724,15 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
+ case AV_PIX_FMT_YUV420P16LE:
+ case AV_PIX_FMT_YUV422P16LE:
+ case AV_PIX_FMT_YUV444P16LE:
++ case AV_PIX_FMT_YUVA444P9LE:
++ case AV_PIX_FMT_YUVA422P9LE:
++ case AV_PIX_FMT_YUVA420P9LE:
++ case AV_PIX_FMT_YUVA422P10LE:
++ case AV_PIX_FMT_YUVA444P10LE:
++ case AV_PIX_FMT_YUVA420P10LE:
++ case AV_PIX_FMT_YUVA420P16LE:
++ case AV_PIX_FMT_YUVA422P16LE:
++ case AV_PIX_FMT_YUVA444P16LE:
+ c->chrToYV12 = bswap16UV_c;
+ break;
+ #else
+@@ -736,6 +745,15 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
+ case AV_PIX_FMT_YUV420P16BE:
+ case AV_PIX_FMT_YUV422P16BE:
+ case AV_PIX_FMT_YUV444P16BE:
++ case AV_PIX_FMT_YUVA444P9BE:
++ case AV_PIX_FMT_YUVA422P9BE:
++ case AV_PIX_FMT_YUVA420P9BE:
++ case AV_PIX_FMT_YUVA422P10BE:
++ case AV_PIX_FMT_YUVA444P10BE:
++ case AV_PIX_FMT_YUVA420P10BE:
++ case AV_PIX_FMT_YUVA420P16BE:
++ case AV_PIX_FMT_YUVA422P16BE:
++ case AV_PIX_FMT_YUVA444P16BE:
+ c->chrToYV12 = bswap16UV_c;
+ break;
+ #endif
+@@ -917,6 +935,18 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
+ case AV_PIX_FMT_GRAY16LE:
+ c->lumToYV12 = bswap16Y_c;
+ break;
++ case AV_PIX_FMT_YUVA444P9LE:
++ case AV_PIX_FMT_YUVA422P9LE:
++ case AV_PIX_FMT_YUVA420P9LE:
++ case AV_PIX_FMT_YUVA444P10LE:
++ case AV_PIX_FMT_YUVA422P10LE:
++ case AV_PIX_FMT_YUVA420P10LE:
++ case AV_PIX_FMT_YUVA420P16LE:
++ case AV_PIX_FMT_YUVA422P16LE:
++ case AV_PIX_FMT_YUVA444P16LE:
++ c->lumToYV12 = bswap16Y_c;
++ c->alpToYV12 = bswap16Y_c;
++ break;
+ #else
+ case AV_PIX_FMT_YUV444P9BE:
+ case AV_PIX_FMT_YUV422P9BE:
+@@ -930,6 +960,18 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
+ case AV_PIX_FMT_GRAY16BE:
+ c->lumToYV12 = bswap16Y_c;
+ break;
++ case AV_PIX_FMT_YUVA444P9BE:
++ case AV_PIX_FMT_YUVA422P9BE:
++ case AV_PIX_FMT_YUVA420P9BE:
++ case AV_PIX_FMT_YUVA444P10BE:
++ case AV_PIX_FMT_YUVA422P10BE:
++ case AV_PIX_FMT_YUVA420P10BE:
++ case AV_PIX_FMT_YUVA420P16BE:
++ case AV_PIX_FMT_YUVA422P16BE:
++ case AV_PIX_FMT_YUVA444P16BE:
++ c->lumToYV12 = bswap16Y_c;
++ c->alpToYV12 = bswap16Y_c;
++ break;
+ #endif
+ case AV_PIX_FMT_YUYV422:
+ case AV_PIX_FMT_Y400A:
+diff --git a/tests/ref/lavfi/pixfmts_scale b/tests/ref/lavfi/pixfmts_scale
+index d8ae09c..7be8af4 100644
+--- a/tests/ref/lavfi/pixfmts_scale
++++ b/tests/ref/lavfi/pixfmts_scale
+@@ -57,25 +57,25 @@ yuv444p16le a0c5d3c7bf3f181db503cf8e450d1335
+ yuv444p9be 9ac2643ce7f7e5c4e17c8c9fd8494d4a
+ yuv444p9le 896a1cc9cccca1ba410dd53942d33cc4
+ yuva420p 8673a9131fb47de69788863f93a50eb7
+-yuva420p10be cf397b35db9407496093b2ad64f3106c
++yuva420p10be d92a95061809f251175f5d5e3074930e
+ yuva420p10le 8a06c377b8aa2b2979054e074582a5b5
+ yuva420p16be a61d8ddb646e2d26020fc7ed2a48c1a9
+ yuva420p16le 90ef774f86ad3177ec57eca8744b4e09
+-yuva420p9be b43d5d88a474c80abad8e887eb5a3317
++yuva420p9be f7655546446bfdc875243d7cdeb13b30
+ yuva420p9le ada2b719827059d70ebc57e2a3f9da92
+ yuva422p 3c76ebeca0a7d3aa5f8e31ef80a86ffe
+-yuva422p10be c12a427d2b8fc84f93fd3cf9fd5bcb14
++yuva422p10be 9a21b2f566c0761c8338edaa88006bee
+ yuva422p10le aefcda062e7e3463c887faa9d926aca7
+-yuva422p16be a31bd04c58c22690f2a7c745f34cf48f
++yuva422p16be c21afa31ac18bd92e8e596b81552b52b
+ yuva422p16le 0bc3720dba6076dcce3b74b1d3c6c4b7
+-yuva422p9be b21d2aa97ff643c86bbc08b578729c39
++yuva422p9be a60ac5b8026e9621724c033fbf79dbda
+ yuva422p9le c3eda8831e9b9c94a3eb487d33114103
+ yuva444p 3268c6abe5e3cdbd16552a1eddced816
+-yuva444p10be 4f6eaf2bbe8a083773b9f061fec20e41
++yuva444p10be 3fbd1ece625c7aa7284b9ca3724d6abb
+ yuva444p10le 2eeda83856df77760cd30e477e8ba00b
+-yuva444p16be 3587f05da58a8435aad648506562d39b
++yuva444p16be ed5b07fe4d5b1137604568786777af1d
+ yuva444p16le 3a3df23feb60d8832b566fd9765983d0
+-yuva444p9be d5342be0074975ea65907f5b65c7a335
++yuva444p9be 4fc479c5b1044ad37b4e6fc6488b4f7f
+ yuva444p9le c41849b0134670d6f6253c337defbb04
+ yuvj420p 30427bd6caf5bda93a173dbebe759e09
+ yuvj422p fc8288f64fd149573f73cf8da05d8e6d
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0100-x86-mmx2-mmxext-in-function-names.patch b/debian/patches/post-9beta2/0100-x86-mmx2-mmxext-in-function-names.patch
new file mode 100644
index 0000000..94aae43
--- /dev/null
+++ b/debian/patches/post-9beta2/0100-x86-mmx2-mmxext-in-function-names.patch
@@ -0,0 +1,1102 @@
+From d8eda3708023db388d80027a79d5df7ee25a5a3f Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 8 Jul 2012 19:56:10 +0200
+Subject: [PATCH 100/204] x86: mmx2 ---> mmxext in function names
+
+---
+ libavcodec/dct-test.c | 4 +-
+ libavcodec/dsputil.h | 2 +-
+ libavcodec/x86/cavsdsp.c | 29 ++++----
+ libavcodec/x86/dsputil_mmx.c | 144 +++++++++++++++++++--------------------
+ libavcodec/x86/dsputil_mmx.h | 10 +--
+ libavcodec/x86/dsputilenc_mmx.c | 25 ++++---
+ libavcodec/x86/fdct.c | 7 +-
+ libavcodec/x86/h264_qpel.c | 54 +++++++--------
+ libavcodec/x86/h264dsp_init.c | 13 ++--
+ libavcodec/x86/idct_mmx_xvid.c | 11 +--
+ libavcodec/x86/idct_xvid.h | 6 +-
+ libavcodec/x86/motion_est.c | 36 +++++-----
+ libavcodec/x86/mpegvideoenc.c | 6 +-
+ libavcodec/x86/vc1dsp_mmx.c | 65 ++++++++++--------
+ libavfilter/x86/gradfun.c | 6 +-
+ libavfilter/x86/yadif.c | 4 +-
+ libswscale/utils.c | 21 +++---
+ libswscale/x86/rgb2rgb.c | 4 +-
+ libswscale/x86/swscale.c | 4 +-
+ libswscale/x86/yuv2rgb.c | 8 ++-
+ 20 files changed, 242 insertions(+), 217 deletions(-)
+
+diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
+index 848ba8a..c480aec 100644
+--- a/libavcodec/dct-test.c
++++ b/libavcodec/dct-test.c
+@@ -83,7 +83,7 @@ static const struct algo fdct_tab[] = {
+
+ #if HAVE_MMX_INLINE
+ { "MMX", ff_fdct_mmx, NO_PERM, AV_CPU_FLAG_MMX },
+- { "MMXEXT", ff_fdct_mmx2, NO_PERM, AV_CPU_FLAG_MMXEXT },
++ { "MMXEXT", ff_fdct_mmxext, NO_PERM, AV_CPU_FLAG_MMXEXT },
+ { "SSE2", ff_fdct_sse2, NO_PERM, AV_CPU_FLAG_SSE2 },
+ #endif
+
+@@ -107,7 +107,7 @@ static const struct algo idct_tab[] = {
+ #if HAVE_MMX_INLINE
+ { "SIMPLE-MMX", ff_simple_idct_mmx, MMX_SIMPLE_PERM, AV_CPU_FLAG_MMX },
+ { "XVID-MMX", ff_idct_xvid_mmx, NO_PERM, AV_CPU_FLAG_MMX, 1 },
+- { "XVID-MMXEXT", ff_idct_xvid_mmx2, NO_PERM, AV_CPU_FLAG_MMXEXT, 1 },
++ { "XVID-MMXEXT", ff_idct_xvid_mmxext, NO_PERM, AV_CPU_FLAG_MMXEXT, 1 },
+ { "XVID-SSE2", ff_idct_xvid_sse2, SSE2_PERM, AV_CPU_FLAG_SSE2, 1 },
+ #endif
+
+diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
+index e38f7a7..f48aa96 100644
+--- a/libavcodec/dsputil.h
++++ b/libavcodec/dsputil.h
+@@ -49,7 +49,7 @@ void ff_j_rev_dct (DCTELEM *data);
+ void ff_wmv2_idct_c(DCTELEM *data);
+
+ void ff_fdct_mmx(DCTELEM *block);
+-void ff_fdct_mmx2(DCTELEM *block);
++void ff_fdct_mmxext(DCTELEM *block);
+ void ff_fdct_sse2(DCTELEM *block);
+
+ #define H264_IDCT(depth) \
+diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
+index b628f08..f94e2f3 100644
+--- a/libavcodec/x86/cavsdsp.c
++++ b/libavcodec/x86/cavsdsp.c
+@@ -438,21 +438,22 @@ static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, ui
+ #endif /* (HAVE_MMXEXT_INLINE || HAVE_AMD3DNOW_INLINE) */
+
+ #if HAVE_MMXEXT_INLINE
+-QPEL_CAVS(put_, PUT_OP, mmx2)
+-QPEL_CAVS(avg_,AVG_MMXEXT_OP, mmx2)
++QPEL_CAVS(put_, PUT_OP, mmxext)
++QPEL_CAVS(avg_, AVG_MMXEXT_OP, mmxext)
+
+-CAVS_MC(put_, 8, mmx2)
+-CAVS_MC(put_, 16,mmx2)
+-CAVS_MC(avg_, 8, mmx2)
+-CAVS_MC(avg_, 16,mmx2)
++CAVS_MC(put_, 8, mmxext)
++CAVS_MC(put_, 16, mmxext)
++CAVS_MC(avg_, 8, mmxext)
++CAVS_MC(avg_, 16, mmxext)
+
+-static void ff_cavsdsp_init_mmx2(CAVSDSPContext* c, AVCodecContext *avctx) {
++static void ff_cavsdsp_init_mmxext(CAVSDSPContext *c, AVCodecContext *avctx)
++{
+ #define dspfunc(PFX, IDX, NUM) \
+- c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_mmx2; \
+- c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_mmx2; \
+- c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_mmx2; \
+- c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_mmx2; \
+- c->PFX ## _pixels_tab[IDX][12] = ff_ ## PFX ## NUM ## _mc03_mmx2; \
++ c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_mmxext; \
++ c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_mmxext; \
++ c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_mmxext; \
++ c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_mmxext; \
++ c->PFX ## _pixels_tab[IDX][12] = ff_ ## PFX ## NUM ## _mc03_mmxext; \
+
+ dspfunc(put_cavs_qpel, 0, 16);
+ dspfunc(put_cavs_qpel, 1, 8);
+@@ -475,7 +476,7 @@ CAVS_MC(avg_, 16,3dnow)
+
+ static void ff_cavsdsp_init_3dnow(CAVSDSPContext* c, AVCodecContext *avctx) {
+ #define dspfunc(PFX, IDX, NUM) \
+- c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_mmx2; \
++ c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_mmxext; \
+ c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_3dnow; \
+ c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_3dnow; \
+ c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_3dnow; \
+@@ -496,7 +497,7 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c, AVCodecContext *avctx)
+ int mm_flags = av_get_cpu_flags();
+
+ #if HAVE_MMXEXT_INLINE
+- if (mm_flags & AV_CPU_FLAG_MMXEXT) ff_cavsdsp_init_mmx2(c, avctx);
++ if (mm_flags & AV_CPU_FLAG_MMXEXT) ff_cavsdsp_init_mmxext(c, avctx);
+ #endif /* HAVE_MMXEXT_INLINE */
+ #if HAVE_AMD3DNOW_INLINE
+ if (mm_flags & AV_CPU_FLAG_3DNOW) ff_cavsdsp_init_3dnow(c, avctx);
+diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
+index 1e78c20..d23279b 100644
+--- a/libavcodec/x86/dsputil_mmx.c
++++ b/libavcodec/x86/dsputil_mmx.c
+@@ -207,7 +207,7 @@ DECLARE_ALIGNED(16, const double, ff_pd_2)[2] = { 2.0, 2.0 };
+ /***********************************/
+ /* MMXEXT specific */
+
+-#define DEF(x) x ## _mmx2
++#define DEF(x) x ## _mmxext
+
+ /* Introduced only in MMXEXT set */
+ #define PAVGB "pavgb"
+@@ -221,11 +221,11 @@ DECLARE_ALIGNED(16, const double, ff_pd_2)[2] = { 2.0, 2.0 };
+
+ #define put_no_rnd_pixels16_mmx put_pixels16_mmx
+ #define put_no_rnd_pixels8_mmx put_pixels8_mmx
+-#define put_pixels16_mmx2 put_pixels16_mmx
+-#define put_pixels8_mmx2 put_pixels8_mmx
+-#define put_pixels4_mmx2 put_pixels4_mmx
+-#define put_no_rnd_pixels16_mmx2 put_no_rnd_pixels16_mmx
+-#define put_no_rnd_pixels8_mmx2 put_no_rnd_pixels8_mmx
++#define put_pixels16_mmxext put_pixels16_mmx
++#define put_pixels8_mmxext put_pixels8_mmx
++#define put_pixels4_mmxext put_pixels4_mmx
++#define put_no_rnd_pixels16_mmxext put_no_rnd_pixels16_mmx
++#define put_no_rnd_pixels8_mmxext put_no_rnd_pixels8_mmx
+ #define put_pixels16_3dnow put_pixels16_mmx
+ #define put_pixels8_3dnow put_pixels8_mmx
+ #define put_pixels4_3dnow put_pixels4_mmx
+@@ -924,11 +924,11 @@ static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
+ OP(%%mm5, out, %%mm7, d)
+
+ #define QPEL_BASE(OPNAME, ROUNDER, RND, OP_MMXEXT, OP_3DNOW) \
+-static void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, \
+- uint8_t *src, \
+- int dstStride, \
+- int srcStride, \
+- int h) \
++static void OPNAME ## mpeg4_qpel16_h_lowpass_mmxext(uint8_t *dst, \
++ uint8_t *src, \
++ int dstStride, \
++ int srcStride, \
++ int h) \
+ { \
+ uint64_t temp; \
+ \
+@@ -1118,11 +1118,11 @@ static void OPNAME ## mpeg4_qpel16_h_lowpass_3dnow(uint8_t *dst, \
+ } \
+ } \
+ \
+-static void OPNAME ## mpeg4_qpel8_h_lowpass_mmx2(uint8_t *dst, \
+- uint8_t *src, \
+- int dstStride, \
+- int srcStride, \
+- int h) \
++static void OPNAME ## mpeg4_qpel8_h_lowpass_mmxext(uint8_t *dst, \
++ uint8_t *src, \
++ int dstStride, \
++ int srcStride, \
++ int h) \
+ { \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+@@ -1755,9 +1755,9 @@ QPEL_BASE(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, PUT_OP)
+ QPEL_OP(put_, ff_pw_16, _, PUT_OP, 3dnow)
+ QPEL_OP(avg_, ff_pw_16, _, AVG_3DNOW_OP, 3dnow)
+ QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, 3dnow)
+-QPEL_OP(put_, ff_pw_16, _, PUT_OP, mmx2)
+-QPEL_OP(avg_, ff_pw_16, _, AVG_MMXEXT_OP, mmx2)
+-QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmx2)
++QPEL_OP(put_, ff_pw_16, _, PUT_OP, mmxext)
++QPEL_OP(avg_, ff_pw_16, _, AVG_MMXEXT_OP, mmxext)
++QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmxext)
+
+ /***********************************/
+ /* bilinear qpel: not compliant to any spec, only for -lavdopts fast */
+@@ -1811,10 +1811,10 @@ QPEL_2TAP_L3(OPNAME, SIZE, MMX, 31, 1, stride, -1) \
+ QPEL_2TAP_L3(OPNAME, SIZE, MMX, 13, stride, -stride, 1) \
+ QPEL_2TAP_L3(OPNAME, SIZE, MMX, 33, stride + 1, -stride, -1) \
+
+-QPEL_2TAP(put_, 16, mmx2)
+-QPEL_2TAP(avg_, 16, mmx2)
+-QPEL_2TAP(put_, 8, mmx2)
+-QPEL_2TAP(avg_, 8, mmx2)
++QPEL_2TAP(put_, 16, mmxext)
++QPEL_2TAP(avg_, 16, mmxext)
++QPEL_2TAP(put_, 8, mmxext)
++QPEL_2TAP(avg_, 8, mmxext)
+ QPEL_2TAP(put_, 16, 3dnow)
+ QPEL_2TAP(avg_, 16, 3dnow)
+ QPEL_2TAP(put_, 8, 3dnow)
+@@ -2035,7 +2035,7 @@ static void name(void *mem, int stride, int h) \
+ } while (--h); \
+ }
+
+-PREFETCH(prefetch_mmx2, prefetcht0)
++PREFETCH(prefetch_mmxext, prefetcht0)
+ PREFETCH(prefetch_3dnow, prefetch)
+ #undef PREFETCH
+
+@@ -2089,22 +2089,22 @@ CHROMA_MC(avg, 8, 10, avx)
+ #if HAVE_INLINE_ASM
+
+ /* CAVS-specific */
+-void ff_put_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride)
++void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride)
+ {
+ put_pixels8_mmx(dst, src, stride, 8);
+ }
+
+-void ff_avg_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride)
++void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride)
+ {
+ avg_pixels8_mmx(dst, src, stride, 8);
+ }
+
+-void ff_put_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride)
++void ff_put_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride)
+ {
+ put_pixels16_mmx(dst, src, stride, 16);
+ }
+
+-void ff_avg_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride)
++void ff_avg_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride)
+ {
+ avg_pixels16_mmx(dst, src, stride, 16);
+ }
+@@ -2116,10 +2116,10 @@ void ff_put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src,
+ put_pixels8_mmx(dst, src, stride, 8);
+ }
+
+-void ff_avg_vc1_mspel_mc00_mmx2(uint8_t *dst, const uint8_t *src,
+- int stride, int rnd)
++void ff_avg_vc1_mspel_mc00_mmxext(uint8_t *dst, const uint8_t *src,
++ int stride, int rnd)
+ {
+- avg_pixels8_mmx2(dst, src, stride, 8);
++ avg_pixels8_mmxext(dst, src, stride, 8);
+ }
+
+ static void vorbis_inverse_coupling_3dnow(float *mag, float *ang, int blocksize)
+@@ -2456,74 +2456,74 @@ static void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx, int mm_flags)
+
+ }
+
+-static void dsputil_init_mmx2(DSPContext *c, AVCodecContext *avctx,
+- int mm_flags)
++static void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
++ int mm_flags)
+ {
+ const int bit_depth = avctx->bits_per_raw_sample;
+ const int high_bit_depth = bit_depth > 8;
+
+ #if HAVE_INLINE_ASM
+- c->prefetch = prefetch_mmx2;
++ c->prefetch = prefetch_mmxext;
+
+ if (!high_bit_depth) {
+- c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2;
+- c->put_pixels_tab[0][2] = put_pixels16_y2_mmx2;
++ c->put_pixels_tab[0][1] = put_pixels16_x2_mmxext;
++ c->put_pixels_tab[0][2] = put_pixels16_y2_mmxext;
+
+- c->avg_pixels_tab[0][0] = avg_pixels16_mmx2;
+- c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmx2;
+- c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmx2;
++ c->avg_pixels_tab[0][0] = avg_pixels16_mmxext;
++ c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmxext;
++ c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmxext;
+
+- c->put_pixels_tab[1][1] = put_pixels8_x2_mmx2;
+- c->put_pixels_tab[1][2] = put_pixels8_y2_mmx2;
++ c->put_pixels_tab[1][1] = put_pixels8_x2_mmxext;
++ c->put_pixels_tab[1][2] = put_pixels8_y2_mmxext;
+
+- c->avg_pixels_tab[1][0] = avg_pixels8_mmx2;
+- c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmx2;
+- c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx2;
++ c->avg_pixels_tab[1][0] = avg_pixels8_mmxext;
++ c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmxext;
++ c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmxext;
+ }
+
+ if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!high_bit_depth) {
+- c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx2;
+- c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx2;
+- c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx2;
+- c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx2;
++ c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmxext;
++ c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmxext;
++ c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmxext;
++ c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmxext;
+
+- c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx2;
+- c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx2;
++ c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmxext;
++ c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmxext;
+ }
+ }
+
+ if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
+- c->idct_put = ff_idct_xvid_mmx2_put;
+- c->idct_add = ff_idct_xvid_mmx2_add;
+- c->idct = ff_idct_xvid_mmx2;
++ c->idct_put = ff_idct_xvid_mmxext_put;
++ c->idct_add = ff_idct_xvid_mmxext_add;
++ c->idct = ff_idct_xvid_mmxext;
+ }
+
+ if (CONFIG_VP3_DECODER && (avctx->codec_id == AV_CODEC_ID_VP3 ||
+ avctx->codec_id == AV_CODEC_ID_THEORA)) {
+- c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_exact_mmx2;
+- c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_exact_mmx2;
++ c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_exact_mmxext;
++ c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_exact_mmxext;
+ }
+ #endif /* HAVE_INLINE_ASM */
+
+ if (CONFIG_H264QPEL) {
+ #if HAVE_INLINE_ASM
+- SET_QPEL_FUNCS(put_qpel, 0, 16, mmx2, );
+- SET_QPEL_FUNCS(put_qpel, 1, 8, mmx2, );
+- SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmx2, );
+- SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmx2, );
+- SET_QPEL_FUNCS(avg_qpel, 0, 16, mmx2, );
+- SET_QPEL_FUNCS(avg_qpel, 1, 8, mmx2, );
++ SET_QPEL_FUNCS(put_qpel, 0, 16, mmxext, );
++ SET_QPEL_FUNCS(put_qpel, 1, 8, mmxext, );
++ SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmxext, );
++ SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmxext, );
++ SET_QPEL_FUNCS(avg_qpel, 0, 16, mmxext, );
++ SET_QPEL_FUNCS(avg_qpel, 1, 8, mmxext, );
+ #endif /* HAVE_INLINE_ASM */
+
+ if (!high_bit_depth) {
+ #if HAVE_INLINE_ASM
+- SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmx2, );
+- SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmx2, );
+- SET_QPEL_FUNCS(put_h264_qpel, 2, 4, mmx2, );
+- SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, mmx2, );
+- SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmx2, );
+- SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmx2, );
++ SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmxext, );
++ SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmxext, );
++ SET_QPEL_FUNCS(put_h264_qpel, 2, 4, mmxext, );
++ SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, mmxext, );
++ SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmxext, );
++ SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmxext, );
+ #endif /* HAVE_INLINE_ASM */
+ } else if (bit_depth == 10) {
+ #if HAVE_YASM
+@@ -2539,10 +2539,10 @@ static void dsputil_init_mmx2(DSPContext *c, AVCodecContext *avctx,
+ }
+
+ #if HAVE_INLINE_ASM
+- SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmx2, );
+- SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmx2, );
+- SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, mmx2, );
+- SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, mmx2, );
++ SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmxext, );
++ SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmxext, );
++ SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, mmxext, );
++ SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, mmxext, );
+ #endif /* HAVE_INLINE_ASM */
+ }
+
+@@ -2861,7 +2861,7 @@ void ff_dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx)
+ dsputil_init_mmx(c, avctx, mm_flags);
+
+ if (mm_flags & AV_CPU_FLAG_MMXEXT)
+- dsputil_init_mmx2(c, avctx, mm_flags);
++ dsputil_init_mmxext(c, avctx, mm_flags);
+
+ if (mm_flags & AV_CPU_FLAG_3DNOW)
+ dsputil_init_3dnow(c, avctx, mm_flags);
+diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h
+index bd14c5a..a142406 100644
+--- a/libavcodec/x86/dsputil_mmx.h
++++ b/libavcodec/x86/dsputil_mmx.h
+@@ -89,13 +89,13 @@ void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_s
+ void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
+ void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
+
+-void ff_put_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride);
+-void ff_avg_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride);
+-void ff_put_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride);
+-void ff_avg_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride);
++void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride);
++void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride);
++void ff_put_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride);
++void ff_avg_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride);
+
+ void ff_put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src, int stride, int rnd);
+-void ff_avg_vc1_mspel_mc00_mmx2(uint8_t *dst, const uint8_t *src, int stride, int rnd);
++void ff_avg_vc1_mspel_mc00_mmxext(uint8_t *dst, const uint8_t *src, int stride, int rnd);
+
+ void ff_put_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, int line_size);
+ void ff_put_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, int line_size);
+diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c
+index 43940bd..883d965 100644
+--- a/libavcodec/x86/dsputilenc_mmx.c
++++ b/libavcodec/x86/dsputilenc_mmx.c
+@@ -647,7 +647,9 @@ static int vsad_intra16_mmx(void *v, uint8_t * pix, uint8_t * dummy, int line_si
+ }
+ #undef SUM
+
+-static int vsad_intra16_mmx2(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) {
++static int vsad_intra16_mmxext(void *v, uint8_t *pix, uint8_t *dummy,
++ int line_size, int h)
++{
+ int tmp;
+
+ assert( (((int)pix) & 7) == 0);
+@@ -765,7 +767,9 @@ static int vsad16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, in
+ }
+ #undef SUM
+
+-static int vsad16_mmx2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
++static int vsad16_mmxext(void *v, uint8_t *pix1, uint8_t *pix2,
++ int line_size, int h)
++{
+ int tmp;
+
+ assert( (((int)pix1) & 7) == 0);
+@@ -844,7 +848,10 @@ static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
+ dst[i+0] = src1[i+0]-src2[i+0];
+ }
+
+-static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top){
++static void sub_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *src1,
++ const uint8_t *src2, int w,
++ int *left, int *left_top)
++{
+ x86_reg i=0;
+ uint8_t l, lt;
+
+@@ -976,7 +983,7 @@ DCT_SAD_FUNC(mmx)
+
+ #define HSUM(a,t,dst) HSUM_MMXEXT(a,t,dst)
+ #define MMABS(a,z) MMABS_MMXEXT(a,z)
+-DCT_SAD_FUNC(mmx2)
++DCT_SAD_FUNC(mmxext)
+ #undef HSUM
+ #undef DCT_SAD
+
+@@ -1115,7 +1122,7 @@ void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
+ if(mm_flags & AV_CPU_FLAG_SSE2){
+ c->fdct = ff_fdct_sse2;
+ } else if (mm_flags & AV_CPU_FLAG_MMXEXT) {
+- c->fdct = ff_fdct_mmx2;
++ c->fdct = ff_fdct_mmxext;
+ }else{
+ c->fdct = ff_fdct_mmx;
+ }
+@@ -1148,14 +1155,14 @@ void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
+ c->ssd_int8_vs_int16 = ssd_int8_vs_int16_mmx;
+
+ if (mm_flags & AV_CPU_FLAG_MMXEXT) {
+- c->sum_abs_dctelem= sum_abs_dctelem_mmx2;
+- c->vsad[4]= vsad_intra16_mmx2;
++ c->sum_abs_dctelem = sum_abs_dctelem_mmxext;
++ c->vsad[4] = vsad_intra16_mmxext;
+
+ if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
+- c->vsad[0] = vsad16_mmx2;
++ c->vsad[0] = vsad16_mmxext;
+ }
+
+- c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_mmx2;
++ c->sub_hfyu_median_prediction = sub_hfyu_median_prediction_mmxext;
+ }
+
+ if(mm_flags & AV_CPU_FLAG_SSE2){
+diff --git a/libavcodec/x86/fdct.c b/libavcodec/x86/fdct.c
+index f9bd3f2..b37238d 100644
+--- a/libavcodec/x86/fdct.c
++++ b/libavcodec/x86/fdct.c
+@@ -440,7 +440,8 @@ static av_always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
+ );
+ }
+
+-static av_always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table)
++static av_always_inline void fdct_row_mmxext(const int16_t *in, int16_t *out,
++ const int16_t *table)
+ {
+ __asm__ volatile (
+ "pshufw $0x1B, 8(%0), %%mm5 \n\t"
+@@ -555,7 +556,7 @@ void ff_fdct_mmx(int16_t *block)
+ }
+ }
+
+-void ff_fdct_mmx2(int16_t *block)
++void ff_fdct_mmxext(int16_t *block)
+ {
+ DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
+ int16_t *block1= (int16_t*)align_tmp;
+@@ -566,7 +567,7 @@ void ff_fdct_mmx2(int16_t *block)
+ fdct_col_mmx(block, block1, 4);
+
+ for(i=8;i>0;i--) {
+- fdct_row_mmx2(block1, block, table);
++ fdct_row_mmxext(block1, block, table);
+ block1 += 8;
+ table += 32;
+ block += 8;
+diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c
+index 5a2db78..f978520 100644
+--- a/libavcodec/x86/h264_qpel.c
++++ b/libavcodec/x86/h264_qpel.c
+@@ -1002,36 +1002,36 @@ static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp,
+ OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 16);\
+ }\
+
+-#define put_pixels8_l2_sse2 put_pixels8_l2_mmx2
+-#define avg_pixels8_l2_sse2 avg_pixels8_l2_mmx2
+-#define put_pixels16_l2_sse2 put_pixels16_l2_mmx2
+-#define avg_pixels16_l2_sse2 avg_pixels16_l2_mmx2
+-#define put_pixels8_l2_ssse3 put_pixels8_l2_mmx2
+-#define avg_pixels8_l2_ssse3 avg_pixels8_l2_mmx2
+-#define put_pixels16_l2_ssse3 put_pixels16_l2_mmx2
+-#define avg_pixels16_l2_ssse3 avg_pixels16_l2_mmx2
++#define put_pixels8_l2_sse2 put_pixels8_l2_mmxext
++#define avg_pixels8_l2_sse2 avg_pixels8_l2_mmxext
++#define put_pixels16_l2_sse2 put_pixels16_l2_mmxext
++#define avg_pixels16_l2_sse2 avg_pixels16_l2_mmxext
++#define put_pixels8_l2_ssse3 put_pixels8_l2_mmxext
++#define avg_pixels8_l2_ssse3 avg_pixels8_l2_mmxext
++#define put_pixels16_l2_ssse3 put_pixels16_l2_mmxext
++#define avg_pixels16_l2_ssse3 avg_pixels16_l2_mmxext
+
+-#define put_pixels8_l2_shift5_sse2 put_pixels8_l2_shift5_mmx2
+-#define avg_pixels8_l2_shift5_sse2 avg_pixels8_l2_shift5_mmx2
+-#define put_pixels16_l2_shift5_sse2 put_pixels16_l2_shift5_mmx2
+-#define avg_pixels16_l2_shift5_sse2 avg_pixels16_l2_shift5_mmx2
+-#define put_pixels8_l2_shift5_ssse3 put_pixels8_l2_shift5_mmx2
+-#define avg_pixels8_l2_shift5_ssse3 avg_pixels8_l2_shift5_mmx2
+-#define put_pixels16_l2_shift5_ssse3 put_pixels16_l2_shift5_mmx2
+-#define avg_pixels16_l2_shift5_ssse3 avg_pixels16_l2_shift5_mmx2
++#define put_pixels8_l2_shift5_sse2 put_pixels8_l2_shift5_mmxext
++#define avg_pixels8_l2_shift5_sse2 avg_pixels8_l2_shift5_mmxext
++#define put_pixels16_l2_shift5_sse2 put_pixels16_l2_shift5_mmxext
++#define avg_pixels16_l2_shift5_sse2 avg_pixels16_l2_shift5_mmxext
++#define put_pixels8_l2_shift5_ssse3 put_pixels8_l2_shift5_mmxext
++#define avg_pixels8_l2_shift5_ssse3 avg_pixels8_l2_shift5_mmxext
++#define put_pixels16_l2_shift5_ssse3 put_pixels16_l2_shift5_mmxext
++#define avg_pixels16_l2_shift5_ssse3 avg_pixels16_l2_shift5_mmxext
+
+-#define put_h264_qpel8_h_lowpass_l2_sse2 put_h264_qpel8_h_lowpass_l2_mmx2
+-#define avg_h264_qpel8_h_lowpass_l2_sse2 avg_h264_qpel8_h_lowpass_l2_mmx2
+-#define put_h264_qpel16_h_lowpass_l2_sse2 put_h264_qpel16_h_lowpass_l2_mmx2
+-#define avg_h264_qpel16_h_lowpass_l2_sse2 avg_h264_qpel16_h_lowpass_l2_mmx2
++#define put_h264_qpel8_h_lowpass_l2_sse2 put_h264_qpel8_h_lowpass_l2_mmxext
++#define avg_h264_qpel8_h_lowpass_l2_sse2 avg_h264_qpel8_h_lowpass_l2_mmxext
++#define put_h264_qpel16_h_lowpass_l2_sse2 put_h264_qpel16_h_lowpass_l2_mmxext
++#define avg_h264_qpel16_h_lowpass_l2_sse2 avg_h264_qpel16_h_lowpass_l2_mmxext
+
+ #define put_h264_qpel8_v_lowpass_ssse3 put_h264_qpel8_v_lowpass_sse2
+ #define avg_h264_qpel8_v_lowpass_ssse3 avg_h264_qpel8_v_lowpass_sse2
+ #define put_h264_qpel16_v_lowpass_ssse3 put_h264_qpel16_v_lowpass_sse2
+ #define avg_h264_qpel16_v_lowpass_ssse3 avg_h264_qpel16_v_lowpass_sse2
+
+-#define put_h264_qpel8or16_hv2_lowpass_sse2 put_h264_qpel8or16_hv2_lowpass_mmx2
+-#define avg_h264_qpel8or16_hv2_lowpass_sse2 avg_h264_qpel8or16_hv2_lowpass_mmx2
++#define put_h264_qpel8or16_hv2_lowpass_sse2 put_h264_qpel8or16_hv2_lowpass_mmxext
++#define avg_h264_qpel8or16_hv2_lowpass_sse2 avg_h264_qpel8or16_hv2_lowpass_mmxext
+
+ #define H264_MC(OPNAME, SIZE, MMX, ALIGN) \
+ H264_MC_C(OPNAME, SIZE, MMX, ALIGN)\
+@@ -1045,8 +1045,8 @@ static void put_h264_qpel16_mc00_sse2 (uint8_t *dst, uint8_t *src, int stride){
+ static void avg_h264_qpel16_mc00_sse2 (uint8_t *dst, uint8_t *src, int stride){
+ avg_pixels16_sse2(dst, src, stride, 16);
+ }
+-#define put_h264_qpel8_mc00_sse2 put_h264_qpel8_mc00_mmx2
+-#define avg_h264_qpel8_mc00_sse2 avg_h264_qpel8_mc00_mmx2
++#define put_h264_qpel8_mc00_sse2 put_h264_qpel8_mc00_mmxext
++#define avg_h264_qpel8_mc00_sse2 avg_h264_qpel8_mc00_mmxext
+
+ #define H264_MC_C(OPNAME, SIZE, MMX, ALIGN) \
+ static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
+@@ -1168,8 +1168,8 @@ QPEL_H264(put_, PUT_OP, 3dnow)
+ QPEL_H264(avg_, AVG_3DNOW_OP, 3dnow)
+ #undef PAVGB
+ #define PAVGB "pavgb"
+-QPEL_H264(put_, PUT_OP, mmx2)
+-QPEL_H264(avg_,AVG_MMXEXT_OP, mmx2)
++QPEL_H264(put_, PUT_OP, mmxext)
++QPEL_H264(avg_, AVG_MMXEXT_OP, mmxext)
+ QPEL_H264_V_XMM(put_, PUT_OP, sse2)
+ QPEL_H264_V_XMM(avg_,AVG_MMXEXT_OP, sse2)
+ QPEL_H264_HV_XMM(put_, PUT_OP, sse2)
+@@ -1185,7 +1185,7 @@ QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, ssse3)
+ #undef PAVGB
+
+ H264_MC_4816(3dnow)
+-H264_MC_4816(mmx2)
++H264_MC_4816(mmxext)
+ H264_MC_816(H264_MC_V, sse2)
+ H264_MC_816(H264_MC_HV, sse2)
+ #if HAVE_SSSE3_INLINE
+diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
+index 3f6ded4..913c362 100644
+--- a/libavcodec/x86/h264dsp_init.c
++++ b/libavcodec/x86/h264dsp_init.c
+@@ -130,18 +130,17 @@ LF_FUNCS(uint16_t, 10)
+
+ #if ARCH_X86_32
+ LF_FUNC(v8, luma, 8, mmx2)
+-static void ff_deblock_v_luma_8_mmx2(uint8_t *pix, int stride, int alpha,
+- int beta, int8_t *tc0)
++static void ff_deblock_v_luma_8_mmxext(uint8_t *pix, int stride, int alpha,
++ int beta, int8_t *tc0)
+ {
+ if ((tc0[0] & tc0[1]) >= 0)
+ ff_deblock_v8_luma_8_mmx2(pix + 0, stride, alpha, beta, tc0);
+ if ((tc0[2] & tc0[3]) >= 0)
+ ff_deblock_v8_luma_8_mmx2(pix + 8, stride, alpha, beta, tc0 + 2);
+ }
+-
+ LF_IFUNC(v8, luma_intra, 8, mmx2)
+-static void ff_deblock_v_luma_intra_8_mmx2(uint8_t *pix, int stride,
+- int alpha, int beta)
++static void ff_deblock_v_luma_intra_8_mmxext(uint8_t *pix, int stride,
++ int alpha, int beta)
+ {
+ ff_deblock_v8_luma_intra_8_mmx2(pix + 0, stride, alpha, beta);
+ ff_deblock_v8_luma_intra_8_mmx2(pix + 8, stride, alpha, beta);
+@@ -246,9 +245,9 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
+ c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_mmx2;
+ }
+ #if ARCH_X86_32
+- c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_mmx2;
++ c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_mmxext;
+ c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_mmx2;
+- c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_mmx2;
++ c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_mmxext;
+ c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmx2;
+ #endif /* ARCH_X86_32 */
+ c->weight_h264_pixels_tab[0] = ff_h264_weight_16_mmx2;
+diff --git a/libavcodec/x86/idct_mmx_xvid.c b/libavcodec/x86/idct_mmx_xvid.c
+index 08a627d..2cf8b47 100644
+--- a/libavcodec/x86/idct_mmx_xvid.c
++++ b/libavcodec/x86/idct_mmx_xvid.c
+@@ -512,7 +512,8 @@ __asm__ volatile(
+ //-----------------------------------------------------------------------------
+
+
+-void ff_idct_xvid_mmx2(short *block){
++void ff_idct_xvid_mmxext(short *block)
++{
+ __asm__ volatile(
+ //# Process each row
+ DCT_8_INV_ROW_XMM(0*16(%0), 0*16(%0), 64*0(%2), 8*0(%1))
+@@ -542,15 +543,15 @@ void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block)
+ ff_add_pixels_clamped_mmx(block, dest, line_size);
+ }
+
+-void ff_idct_xvid_mmx2_put(uint8_t *dest, int line_size, DCTELEM *block)
++void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, DCTELEM *block)
+ {
+- ff_idct_xvid_mmx2(block);
++ ff_idct_xvid_mmxext(block);
+ ff_put_pixels_clamped_mmx(block, dest, line_size);
+ }
+
+-void ff_idct_xvid_mmx2_add(uint8_t *dest, int line_size, DCTELEM *block)
++void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, DCTELEM *block)
+ {
+- ff_idct_xvid_mmx2(block);
++ ff_idct_xvid_mmxext(block);
+ ff_add_pixels_clamped_mmx(block, dest, line_size);
+ }
+
+diff --git a/libavcodec/x86/idct_xvid.h b/libavcodec/x86/idct_xvid.h
+index 82fa990..79d5bf9 100644
+--- a/libavcodec/x86/idct_xvid.h
++++ b/libavcodec/x86/idct_xvid.h
+@@ -34,9 +34,9 @@ void ff_idct_xvid_mmx(short *block);
+ void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block);
+ void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block);
+
+-void ff_idct_xvid_mmx2(short *block);
+-void ff_idct_xvid_mmx2_put(uint8_t *dest, int line_size, DCTELEM *block);
+-void ff_idct_xvid_mmx2_add(uint8_t *dest, int line_size, DCTELEM *block);
++void ff_idct_xvid_mmxext(short *block);
++void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, DCTELEM *block);
++void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, DCTELEM *block);
+
+ void ff_idct_xvid_sse2(short *block);
+ void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block);
+diff --git a/libavcodec/x86/motion_est.c b/libavcodec/x86/motion_est.c
+index 6eb44d4..0a0cab9 100644
+--- a/libavcodec/x86/motion_est.c
++++ b/libavcodec/x86/motion_est.c
+@@ -74,7 +74,8 @@ static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
+ );
+ }
+
+-static inline void sad8_1_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
++static inline void sad8_1_mmxext(uint8_t *blk1, uint8_t *blk2,
++ int stride, int h)
+ {
+ __asm__ volatile(
+ ".p2align 4 \n\t"
+@@ -120,7 +121,8 @@ static int sad16_sse2(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)
+ return ret;
+ }
+
+-static inline void sad8_x2a_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
++static inline void sad8_x2a_mmxext(uint8_t *blk1, uint8_t *blk2,
++ int stride, int h)
+ {
+ __asm__ volatile(
+ ".p2align 4 \n\t"
+@@ -142,7 +144,8 @@ static inline void sad8_x2a_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h
+ );
+ }
+
+-static inline void sad8_y2a_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
++static inline void sad8_y2a_mmxext(uint8_t *blk1, uint8_t *blk2,
++ int stride, int h)
+ {
+ __asm__ volatile(
+ "movq (%1), %%mm0 \n\t"
+@@ -167,7 +170,8 @@ static inline void sad8_y2a_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h
+ );
+ }
+
+-static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
++static inline void sad8_4_mmxext(uint8_t *blk1, uint8_t *blk2,
++ int stride, int h)
+ {
+ __asm__ volatile(
+ "movq "MANGLE(bone)", %%mm5 \n\t"
+@@ -304,7 +308,7 @@ static inline int sum_mmx(void)
+ return ret&0xFFFF;
+ }
+
+-static inline int sum_mmx2(void)
++static inline int sum_mmxext(void)
+ {
+ int ret;
+ __asm__ volatile(
+@@ -424,7 +428,7 @@ static int sad16_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride,
+ }\
+
+ PIX_SAD(mmx)
+-PIX_SAD(mmx2)
++PIX_SAD(mmxext)
+
+ #endif /* HAVE_INLINE_ASM */
+
+@@ -447,19 +451,19 @@ void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx)
+ c->sad[1]= sad8_mmx;
+ }
+ if (mm_flags & AV_CPU_FLAG_MMXEXT) {
+- c->pix_abs[0][0] = sad16_mmx2;
+- c->pix_abs[1][0] = sad8_mmx2;
++ c->pix_abs[0][0] = sad16_mmxext;
++ c->pix_abs[1][0] = sad8_mmxext;
+
+- c->sad[0]= sad16_mmx2;
+- c->sad[1]= sad8_mmx2;
++ c->sad[0] = sad16_mmxext;
++ c->sad[1] = sad8_mmxext;
+
+ if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
+- c->pix_abs[0][1] = sad16_x2_mmx2;
+- c->pix_abs[0][2] = sad16_y2_mmx2;
+- c->pix_abs[0][3] = sad16_xy2_mmx2;
+- c->pix_abs[1][1] = sad8_x2_mmx2;
+- c->pix_abs[1][2] = sad8_y2_mmx2;
+- c->pix_abs[1][3] = sad8_xy2_mmx2;
++ c->pix_abs[0][1] = sad16_x2_mmxext;
++ c->pix_abs[0][2] = sad16_y2_mmxext;
++ c->pix_abs[0][3] = sad16_xy2_mmxext;
++ c->pix_abs[1][1] = sad8_x2_mmxext;
++ c->pix_abs[1][2] = sad8_y2_mmxext;
++ c->pix_abs[1][3] = sad8_xy2_mmxext;
+ }
+ }
+ if ((mm_flags & AV_CPU_FLAG_SSE2) && !(mm_flags & AV_CPU_FLAG_3DNOW) && avctx->codec_id != AV_CODEC_ID_SNOW) {
+diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c
+index 59e3580..8f7c2e4 100644
+--- a/libavcodec/x86/mpegvideoenc.c
++++ b/libavcodec/x86/mpegvideoenc.c
+@@ -47,8 +47,8 @@ extern uint16_t ff_inv_zigzag_direct16[64];
+ #define COMPILE_TEMPLATE_SSSE3 0
+ #undef RENAME
+ #undef RENAMEl
+-#define RENAME(a) a ## _MMX2
+-#define RENAMEl(a) a ## _mmx2
++#define RENAME(a) a ## _MMXEXT
++#define RENAMEl(a) a ## _mmxext
+ #include "mpegvideoenc_template.c"
+ #endif /* HAVE_MMXEXT_INLINE */
+
+@@ -92,7 +92,7 @@ void ff_MPV_encode_init_x86(MpegEncContext *s)
+ #endif
+ #if HAVE_MMXEXT_INLINE
+ if (INLINE_MMXEXT(mm_flags))
+- s->dct_quantize = dct_quantize_MMX2;
++ s->dct_quantize = dct_quantize_MMXEXT;
+ #endif
+ #if HAVE_SSE2_INLINE
+ if (INLINE_SSE2(mm_flags))
+diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c
+index 6b1ae37..b02582f 100644
+--- a/libavcodec/x86/vc1dsp_mmx.c
++++ b/libavcodec/x86/vc1dsp_mmx.c
+@@ -467,7 +467,10 @@ VC1_MSPEL_MC(avg_)
+ static void put_vc1_mspel_mc ## a ## b ## _mmx(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
+ put_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
+ }\
+-static void avg_vc1_mspel_mc ## a ## b ## _mmx2(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
++static void avg_vc1_mspel_mc ## a ## b ## _mmxext(uint8_t *dst, \
++ const uint8_t *src, \
++ int stride, int rnd) \
++{ \
+ avg_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
+ }
+
+@@ -490,7 +493,8 @@ DECLARE_FUNCTION(3, 1)
+ DECLARE_FUNCTION(3, 2)
+ DECLARE_FUNCTION(3, 3)
+
+-static void vc1_inv_trans_4x4_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *block)
++static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize,
++ DCTELEM *block)
+ {
+ int dc = block[0];
+ dc = (17 * dc + 4) >> 3;
+@@ -528,7 +532,8 @@ static void vc1_inv_trans_4x4_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *bloc
+ );
+ }
+
+-static void vc1_inv_trans_4x8_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *block)
++static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,
++ DCTELEM *block)
+ {
+ int dc = block[0];
+ dc = (17 * dc + 4) >> 3;
+@@ -589,7 +594,8 @@ static void vc1_inv_trans_4x8_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *bloc
+ );
+ }
+
+-static void vc1_inv_trans_8x4_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *block)
++static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize,
++ DCTELEM *block)
+ {
+ int dc = block[0];
+ dc = ( 3 * dc + 1) >> 1;
+@@ -627,7 +633,8 @@ static void vc1_inv_trans_8x4_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *bloc
+ );
+ }
+
+-static void vc1_inv_trans_8x8_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *block)
++static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,
++ DCTELEM *block)
+ {
+ int dc = block[0];
+ dc = (3 * dc + 1) >> 1;
+@@ -713,29 +720,29 @@ av_cold void ff_vc1dsp_init_mmx(VC1DSPContext *dsp)
+
+ av_cold void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp)
+ {
+- dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_mmx2;
+-
+- dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_mmx2;
+-
+- dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_mmx2;
+-
+- dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_mmx2;
+- dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_mmx2;
+-
+- dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_mmx2;
+- dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_mmx2;
+- dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_mmx2;
+- dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_mmx2;
++ dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_mmxext;
++
++ dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_mmxext;
++
++ dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_mmxext;
++
++ dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_mmxext;
++ dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_mmxext;
++
++ dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_mmxext;
++ dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_mmxext;
++ dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_mmxext;
++ dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_mmxext;
+ }
+ #endif /* HAVE_INLINE_ASM */
+diff --git a/libavfilter/x86/gradfun.c b/libavfilter/x86/gradfun.c
+index 424a031..b4ca86c 100644
+--- a/libavfilter/x86/gradfun.c
++++ b/libavfilter/x86/gradfun.c
+@@ -30,7 +30,9 @@ DECLARE_ALIGNED(16, static const uint16_t, pw_7f)[8] = {0x7F,0x7F,0x7F,0x7F,0x7F
+ DECLARE_ALIGNED(16, static const uint16_t, pw_ff)[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
+
+ #if HAVE_MMXEXT_INLINE
+-static void gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers)
++static void gradfun_filter_line_mmxext(uint8_t *dst, uint8_t *src, uint16_t *dc,
++ int width, int thresh,
++ const uint16_t *dithers)
+ {
+ intptr_t x;
+ if (width & 3) {
+@@ -175,7 +177,7 @@ av_cold void ff_gradfun_init_x86(GradFunContext *gf)
+
+ #if HAVE_MMXEXT_INLINE
+ if (cpu_flags & AV_CPU_FLAG_MMXEXT)
+- gf->filter_line = gradfun_filter_line_mmx2;
++ gf->filter_line = gradfun_filter_line_mmxext;
+ #endif
+ #if HAVE_SSSE3_INLINE
+ if (cpu_flags & AV_CPU_FLAG_SSSE3)
+diff --git a/libavfilter/x86/yadif.c b/libavfilter/x86/yadif.c
+index f178b32..ab1d282 100644
+--- a/libavfilter/x86/yadif.c
++++ b/libavfilter/x86/yadif.c
+@@ -49,7 +49,7 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
+
+ #if HAVE_MMXEXT_INLINE
+ #undef RENAME
+-#define RENAME(a) a ## _mmx2
++#define RENAME(a) a ## _mmxext
+ #include "yadif_template.c"
+ #endif
+
+@@ -61,7 +61,7 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
+
+ #if HAVE_MMXEXT_INLINE
+ if (cpu_flags & AV_CPU_FLAG_MMXEXT)
+- yadif->filter_line = yadif_filter_line_mmx2;
++ yadif->filter_line = yadif_filter_line_mmxext;
+ #endif
+ #if HAVE_SSE2_INLINE
+ if (cpu_flags & AV_CPU_FLAG_SSE2)
+diff --git a/libswscale/utils.c b/libswscale/utils.c
+index 64a3a58..e5e4d60 100644
+--- a/libswscale/utils.c
++++ b/libswscale/utils.c
+@@ -600,8 +600,9 @@ fail:
+ }
+
+ #if HAVE_MMXEXT_INLINE
+-static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode,
+- int16_t *filter, int32_t *filterPos, int numSplits)
++static int init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode,
++ int16_t *filter, int32_t *filterPos,
++ int numSplits)
+ {
+ uint8_t *fragmentA;
+ x86_reg imm8OfPShufW1A;
+@@ -1043,10 +1044,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
+ #if HAVE_MMXEXT_INLINE
+ // can't downscale !!!
+ if (c->canMMXEXTBeUsed && (flags & SWS_FAST_BILINEAR)) {
+- c->lumMmxextFilterCodeSize = initMMX2HScaler(dstW, c->lumXInc, NULL,
+- NULL, NULL, 8);
+- c->chrMmxextFilterCodeSize = initMMX2HScaler(c->chrDstW, c->chrXInc,
+- NULL, NULL, NULL, 4);
++ c->lumMmxextFilterCodeSize = init_hscaler_mmxext(dstW, c->lumXInc, NULL,
++ NULL, NULL, 8);
++ c->chrMmxextFilterCodeSize = init_hscaler_mmxext(c->chrDstW, c->chrXInc,
++ NULL, NULL, NULL, 4);
+
+ #if USE_MMAP
+ c->lumMmxextFilterCode = mmap(NULL, c->lumMmxextFilterCodeSize,
+@@ -1078,10 +1079,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
+ FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW / 2 / 8 + 8) * sizeof(int32_t), fail);
+ FF_ALLOCZ_OR_GOTO(c, c->hChrFilterPos, (c->chrDstW / 2 / 4 + 8) * sizeof(int32_t), fail);
+
+- initMMX2HScaler(dstW, c->lumXInc, c->lumMmxextFilterCode,
+- c->hLumFilter, c->hLumFilterPos, 8);
+- initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmxextFilterCode,
+- c->hChrFilter, c->hChrFilterPos, 4);
++ init_hscaler_mmxext(dstW, c->lumXInc, c->lumMmxextFilterCode,
++ c->hLumFilter, c->hLumFilterPos, 8);
++ init_hscaler_mmxext(c->chrDstW, c->chrXInc, c->chrMmxextFilterCode,
++ c->hChrFilter, c->hChrFilterPos, 4);
+
+ #if USE_MMAP
+ mprotect(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ);
+diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
+index 486f436..d4f2580 100644
+--- a/libswscale/x86/rgb2rgb.c
++++ b/libswscale/x86/rgb2rgb.c
+@@ -99,7 +99,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
+ #undef RENAME
+ #undef COMPILE_TEMPLATE_MMXEXT
+ #define COMPILE_TEMPLATE_MMXEXT 1
+-#define RENAME(a) a ## _MMX2
++#define RENAME(a) a ## _MMXEXT
+ #include "rgb2rgb_template.c"
+
+ //SSE2 versions
+@@ -139,7 +139,7 @@ av_cold void rgb2rgb_init_x86(void)
+ if (INLINE_AMD3DNOW(cpu_flags))
+ rgb2rgb_init_3DNOW();
+ if (INLINE_MMXEXT(cpu_flags))
+- rgb2rgb_init_MMX2();
++ rgb2rgb_init_MMXEXT();
+ if (INLINE_SSE2(cpu_flags))
+ rgb2rgb_init_SSE2();
+ #endif /* HAVE_INLINE_ASM */
+diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
+index fc74d97..571510a 100644
+--- a/libswscale/x86/swscale.c
++++ b/libswscale/x86/swscale.c
+@@ -83,7 +83,7 @@ DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL;
+ #undef RENAME
+ #undef COMPILE_TEMPLATE_MMXEXT
+ #define COMPILE_TEMPLATE_MMXEXT 1
+-#define RENAME(a) a ## _MMX2
++#define RENAME(a) a ## _MMXEXT
+ #include "swscale_template.c"
+ #endif
+
+@@ -311,7 +311,7 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c)
+ sws_init_swScale_MMX(c);
+ #if HAVE_MMXEXT_INLINE
+ if (cpu_flags & AV_CPU_FLAG_MMXEXT)
+- sws_init_swScale_MMX2(c);
++ sws_init_swScale_MMXEXT(c);
+ #endif
+ #endif /* HAVE_INLINE_ASM */
+
+diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c
+index 17ac3e2..419d513 100644
+--- a/libswscale/x86/yuv2rgb.c
++++ b/libswscale/x86/yuv2rgb.c
+@@ -63,7 +63,7 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL;
+ #undef RENAME
+ #undef COMPILE_TEMPLATE_MMXEXT
+ #define COMPILE_TEMPLATE_MMXEXT 1
+-#define RENAME(a) a ## _MMX2
++#define RENAME(a) a ## _MMXEXT
+ #include "yuv2rgb_template.c"
+ #endif /* HAVE_MMXEXT_INLINE */
+
+@@ -81,8 +81,10 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
+ #if HAVE_MMXEXT_INLINE
+ if (cpu_flags & AV_CPU_FLAG_MMXEXT) {
+ switch (c->dstFormat) {
+- case AV_PIX_FMT_RGB24: return yuv420_rgb24_MMX2;
+- case AV_PIX_FMT_BGR24: return yuv420_bgr24_MMX2;
++ case AV_PIX_FMT_RGB24:
++ return yuv420_rgb24_MMXEXT;
++ case AV_PIX_FMT_BGR24:
++ return yuv420_bgr24_MMXEXT;
+ }
+ }
+ #endif
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0101-x86-h264_chromamc_10bit-drop-pointless-PAVG-define.patch b/debian/patches/post-9beta2/0101-x86-h264_chromamc_10bit-drop-pointless-PAVG-define.patch
new file mode 100644
index 0000000..e3cb5e2
--- /dev/null
+++ b/debian/patches/post-9beta2/0101-x86-h264_chromamc_10bit-drop-pointless-PAVG-define.patch
@@ -0,0 +1,35 @@
+From fa8fcab1e0d31074c0644c4ac5194474c6c26415 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Fri, 27 Jul 2012 13:43:33 +0200
+Subject: [PATCH 101/204] x86: h264_chromamc_10bit: drop pointless PAVG
+ %define
+
+It is only used in one place so there is no need for the abstraction.
+---
+ libavcodec/x86/h264_chromamc_10bit.asm | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/libavcodec/x86/h264_chromamc_10bit.asm b/libavcodec/x86/h264_chromamc_10bit.asm
+index 4481efe..d24308d 100644
+--- a/libavcodec/x86/h264_chromamc_10bit.asm
++++ b/libavcodec/x86/h264_chromamc_10bit.asm
+@@ -245,7 +245,7 @@ cglobal %1_h264_chroma_mc2_10, 6,7
+ %if %0==3
+ movq %2, %3
+ %endif
+- PAVG %1, %2
++ pavgw %1, %2
+ %endmacro
+
+ %define CHROMAMC_AVG NOTHING
+@@ -260,7 +260,6 @@ CHROMA_MC4 put
+ CHROMA_MC2 put
+
+ %define CHROMAMC_AVG AVG
+-%define PAVG pavgw
+ INIT_XMM sse2
+ CHROMA_MC8 avg
+ %if HAVE_AVX_EXTERNAL
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0102-x86-Move-optimization-suffix-to-end-of-function-name.patch b/debian/patches/post-9beta2/0102-x86-Move-optimization-suffix-to-end-of-function-name.patch
new file mode 100644
index 0000000..eafdbac
--- /dev/null
+++ b/debian/patches/post-9beta2/0102-x86-Move-optimization-suffix-to-end-of-function-name.patch
@@ -0,0 +1,198 @@
+From c37322e68c528717930575ed55fc0e819a8ee215 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Fri, 27 Jul 2012 14:09:52 +0200
+Subject: [PATCH 102/204] x86: Move optimization suffix to end of function
+ names
+
+This simplifies cpuflags porting.
+---
+ libavcodec/x86/dsputil_mmx.c | 20 ++++++++++----------
+ libavcodec/x86/h264_chromamc.asm | 20 ++++++++++----------
+ libavcodec/x86/vc1dsp_init.c | 20 ++++++++++----------
+ 3 files changed, 30 insertions(+), 30 deletions(-)
+
+diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
+index d23279b..74559f4 100644
+--- a/libavcodec/x86/dsputil_mmx.c
++++ b/libavcodec/x86/dsputil_mmx.c
+@@ -2043,11 +2043,11 @@ PREFETCH(prefetch_3dnow, prefetch)
+
+ #include "h264_qpel.c"
+
+-void ff_put_h264_chroma_mc8_mmx_rnd (uint8_t *dst, uint8_t *src,
++void ff_put_h264_chroma_mc8_rnd_mmx (uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+-void ff_avg_h264_chroma_mc8_mmx2_rnd (uint8_t *dst, uint8_t *src,
++void ff_avg_h264_chroma_mc8_rnd_mmx2 (uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+-void ff_avg_h264_chroma_mc8_3dnow_rnd(uint8_t *dst, uint8_t *src,
++void ff_avg_h264_chroma_mc8_rnd_3dnow(uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+
+ void ff_put_h264_chroma_mc4_mmx (uint8_t *dst, uint8_t *src,
+@@ -2062,12 +2062,12 @@ void ff_put_h264_chroma_mc2_mmx2 (uint8_t *dst, uint8_t *src,
+ void ff_avg_h264_chroma_mc2_mmx2 (uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+
+-void ff_put_h264_chroma_mc8_ssse3_rnd(uint8_t *dst, uint8_t *src,
++void ff_put_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+ void ff_put_h264_chroma_mc4_ssse3 (uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+
+-void ff_avg_h264_chroma_mc8_ssse3_rnd(uint8_t *dst, uint8_t *src,
++void ff_avg_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+ void ff_avg_h264_chroma_mc4_ssse3 (uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+@@ -2447,7 +2447,7 @@ static void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx, int mm_flags)
+ #endif
+
+ if (!high_bit_depth && CONFIG_H264CHROMA) {
+- c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_mmx_rnd;
++ c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_rnd_mmx;
+ c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_mmx;
+ }
+
+@@ -2548,7 +2548,7 @@ static void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
+
+ #if HAVE_YASM
+ if (!high_bit_depth && CONFIG_H264CHROMA) {
+- c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_mmx2_rnd;
++ c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_rnd_mmx2;
+ c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_mmx2;
+ c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_mmx2;
+ c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_mmx2;
+@@ -2643,7 +2643,7 @@ static void dsputil_init_3dnow(DSPContext *c, AVCodecContext *avctx,
+
+ #if HAVE_YASM
+ if (!high_bit_depth && CONFIG_H264CHROMA) {
+- c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_3dnow_rnd;
++ c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_rnd_3dnow;
+ c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_3dnow;
+ }
+ #endif /* HAVE_YASM */
+@@ -2796,8 +2796,8 @@ static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
+ H264_QPEL_FUNCS_10(3, 0, ssse3_cache64);
+ }
+ if (!high_bit_depth && CONFIG_H264CHROMA) {
+- c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_ssse3_rnd;
+- c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_ssse3_rnd;
++ c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_rnd_ssse3;
++ c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_rnd_ssse3;
+ c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_ssse3;
+ c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_ssse3;
+ }
+diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm
+index e3aff0b..dc427d7 100644
+--- a/libavcodec/x86/h264_chromamc.asm
++++ b/libavcodec/x86/h264_chromamc.asm
+@@ -437,8 +437,8 @@ cglobal %1_%2_chroma_mc2_%3, 6, 7, 0
+ INIT_MMX
+ %define CHROMAMC_AVG NOTHING
+ %define CHROMAMC_AVG4 NOTHING
+-chroma_mc8_mmx_func put, h264, mmx_rnd
+-chroma_mc8_mmx_func put, vc1, mmx_nornd
++chroma_mc8_mmx_func put, h264, rnd_mmx
++chroma_mc8_mmx_func put, vc1, nornd_mmx
+ chroma_mc8_mmx_func put, rv40, mmx
+ chroma_mc4_mmx_func put, h264, mmx
+ chroma_mc4_mmx_func put, rv40, mmx
+@@ -447,16 +447,16 @@ chroma_mc2_mmx_func put, h264, mmx2
+ %define CHROMAMC_AVG DIRECT_AVG
+ %define CHROMAMC_AVG4 COPY_AVG
+ %define PAVG pavgb
+-chroma_mc8_mmx_func avg, h264, mmx2_rnd
+-chroma_mc8_mmx_func avg, vc1, mmx2_nornd
++chroma_mc8_mmx_func avg, h264, rnd_mmx2
++chroma_mc8_mmx_func avg, vc1, nornd_mmx2
+ chroma_mc8_mmx_func avg, rv40, mmx2
+ chroma_mc4_mmx_func avg, h264, mmx2
+ chroma_mc4_mmx_func avg, rv40, mmx2
+ chroma_mc2_mmx_func avg, h264, mmx2
+
+ %define PAVG pavgusb
+-chroma_mc8_mmx_func avg, h264, 3dnow_rnd
+-chroma_mc8_mmx_func avg, vc1, 3dnow_nornd
++chroma_mc8_mmx_func avg, h264, rnd_3dnow
++chroma_mc8_mmx_func avg, vc1, nornd_3dnow
+ chroma_mc8_mmx_func avg, rv40, 3dnow
+ chroma_mc4_mmx_func avg, h264, 3dnow
+ chroma_mc4_mmx_func avg, rv40, 3dnow
+@@ -664,15 +664,15 @@ cglobal %1_%2_chroma_mc4_%3, 6, 7, 0
+
+ %define CHROMAMC_AVG NOTHING
+ INIT_XMM
+-chroma_mc8_ssse3_func put, h264, ssse3_rnd
+-chroma_mc8_ssse3_func put, vc1, ssse3_nornd
++chroma_mc8_ssse3_func put, h264, rnd_ssse3
++chroma_mc8_ssse3_func put, vc1, nornd_ssse3
+ INIT_MMX
+ chroma_mc4_ssse3_func put, h264, ssse3
+
+ %define CHROMAMC_AVG DIRECT_AVG
+ %define PAVG pavgb
+ INIT_XMM
+-chroma_mc8_ssse3_func avg, h264, ssse3_rnd
+-chroma_mc8_ssse3_func avg, vc1, ssse3_nornd
++chroma_mc8_ssse3_func avg, h264, rnd_ssse3
++chroma_mc8_ssse3_func avg, vc1, nornd_ssse3
+ INIT_MMX
+ chroma_mc4_ssse3_func avg, h264, ssse3
+diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
+index d2548fc..6d868e8 100644
+--- a/libavcodec/x86/vc1dsp_init.c
++++ b/libavcodec/x86/vc1dsp_init.c
+@@ -62,15 +62,15 @@ static void vc1_h_loop_filter16_sse4(uint8_t *src, int stride, int pq)
+ }
+ #endif /* HAVE_YASM */
+
+-void ff_put_vc1_chroma_mc8_mmx_nornd (uint8_t *dst, uint8_t *src,
++void ff_put_vc1_chroma_mc8_nornd_mmx (uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+-void ff_avg_vc1_chroma_mc8_mmx2_nornd (uint8_t *dst, uint8_t *src,
++void ff_avg_vc1_chroma_mc8_nornd_mmx2 (uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+-void ff_avg_vc1_chroma_mc8_3dnow_nornd(uint8_t *dst, uint8_t *src,
++void ff_avg_vc1_chroma_mc8_nornd_3dnow(uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+-void ff_put_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst, uint8_t *src,
++void ff_put_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+-void ff_avg_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst, uint8_t *src,
++void ff_avg_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y);
+
+
+@@ -94,14 +94,14 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
+
+ #if HAVE_YASM
+ if (mm_flags & AV_CPU_FLAG_MMX) {
+- dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_mmx_nornd;
++ dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_nornd_mmx;
+ }
+
+ if (mm_flags & AV_CPU_FLAG_MMXEXT) {
+ ASSIGN_LF(mmx2);
+- dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_mmx2_nornd;
++ dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_mmx2;
+ } else if (mm_flags & AV_CPU_FLAG_3DNOW) {
+- dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_3dnow_nornd;
++ dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_3dnow;
+ }
+
+ if (mm_flags & AV_CPU_FLAG_SSE2) {
+@@ -112,8 +112,8 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
+ }
+ if (mm_flags & AV_CPU_FLAG_SSSE3) {
+ ASSIGN_LF(ssse3);
+- dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_ssse3_nornd;
+- dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_ssse3_nornd;
++ dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_nornd_ssse3;
++ dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_ssse3;
+ }
+ if (mm_flags & AV_CPU_FLAG_SSE4) {
+ dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse4;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0103-avconv_opt-cmdutils-Add-missing-function-parameter-D.patch b/debian/patches/post-9beta2/0103-avconv_opt-cmdutils-Add-missing-function-parameter-D.patch
new file mode 100644
index 0000000..fe7cc0c
--- /dev/null
+++ b/debian/patches/post-9beta2/0103-avconv_opt-cmdutils-Add-missing-function-parameter-D.patch
@@ -0,0 +1,75 @@
+From 02e4275180866acc0f42281d1c5ef5a46552da84 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Wed, 24 Oct 2012 19:20:13 +0200
+Subject: [PATCH 103/204] avconv_opt, cmdutils: Add missing function parameter
+ Doxygen
+
+---
+ avconv_opt.c | 1 +
+ cmdutils.h | 8 ++++++++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/avconv_opt.c b/avconv_opt.c
+index 0eb601b..ffb6c65 100644
+--- a/avconv_opt.c
++++ b/avconv_opt.c
+@@ -276,6 +276,7 @@ static int opt_attach(void *optctx, const char *opt, const char *arg)
+
+ /**
+ * Parse a metadata specifier passed as 'arg' parameter.
++ * @param arg metadata string to parse
+ * @param type metadata type is written here -- g(lobal)/s(tream)/c(hapter)/p(rogram)
+ * @param index for type c/p, chapter/program index is written here
+ * @param stream_spec for type s, the stream specifier is written here
+diff --git a/cmdutils.h b/cmdutils.h
+index dd86235..4cb5b83 100644
+--- a/cmdutils.h
++++ b/cmdutils.h
+@@ -186,6 +186,8 @@ int show_help(void *optctx, const char *opt, const char *arg);
+ * Parse the command line arguments.
+ *
+ * @param optctx an opaque options context
++ * @param argc number of command line arguments
++ * @param argv values of command line arguments
+ * @param options Array with the definitions required to interpret every
+ * option of the form: -option_name [argument]
+ * @param parse_arg_function Name of the function called to process every
+@@ -231,6 +233,8 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
+ * Create a new options dictionary containing only the options from
+ * opts which apply to the codec with ID codec_id.
+ *
++ * @param opts dictionary to place options in
++ * @param codec_id ID of the codec that should be filtered for
+ * @param s Corresponding format context.
+ * @param st A stream from s for which the options should be filtered.
+ * @param codec The particular codec for which the options should be filtered.
+@@ -349,6 +353,7 @@ int read_yesno(void);
+ * Read the file with name filename, and put its content in a newly
+ * allocated 0-terminated buffer.
+ *
++ * @param filename file to read from
+ * @param bufptr location where pointer to buffer is returned
+ * @param size location where size of buffer is returned
+ * @return 0 in case of success, a negative value corresponding to an
+@@ -373,6 +378,7 @@ void init_pts_correction(PtsCorrectionContext *ctx);
+ * which might have incorrect times. Input timestamps may wrap around, in
+ * which case the output will as well.
+ *
++ * @param ctx the PtsCorrectionContext carrying stream pts information
+ * @param pts the pts field of the decoded AVPacket, as passed through
+ * AVCodecContext.reordered_opaque
+ * @param dts the dts field of the decoded AVPacket
+@@ -404,8 +410,10 @@ FILE *get_preset_file(char *filename, size_t filename_size,
+ * Realloc array to hold new_size elements of elem_size.
+ * Calls exit() on failure.
+ *
++ * @param array array to reallocate
+ * @param elem_size size in bytes of each element
+ * @param size new element count will be written here
++ * @param new_size number of elements to place in reallocated array
+ * @return reallocated array
+ */
+ void *grow_array(void *array, int elem_size, int *size, int new_size);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0104-fate-add-ac3-eac3-tests-to-FATE_SAMPLES_AVCONV.patch b/debian/patches/post-9beta2/0104-fate-add-ac3-eac3-tests-to-FATE_SAMPLES_AVCONV.patch
new file mode 100644
index 0000000..04ace58
--- /dev/null
+++ b/debian/patches/post-9beta2/0104-fate-add-ac3-eac3-tests-to-FATE_SAMPLES_AVCONV.patch
@@ -0,0 +1,25 @@
+From 6b07830a77729fe25c30026feabd53e8c4c5eb9e Mon Sep 17 00:00:00 2001
+From: Janne Grunau <janne-libav at jannau.net>
+Date: Wed, 31 Oct 2012 19:56:02 +0100
+Subject: [PATCH 104/204] fate: add ac3/eac3 tests to FATE_SAMPLES_AVCONV
+
+Fixes typo in 2cbdd7c92958cb8226491d8eb23ed2d57d4b841e.
+---
+ tests/fate/ac3.mak | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/fate/ac3.mak b/tests/fate/ac3.mak
+index 59d0780..46e7a38 100644
+--- a/tests/fate/ac3.mak
++++ b/tests/fate/ac3.mak
+@@ -71,6 +71,6 @@ fate-ac3-fixed-encode: CMD = md5 -i $(SRC) -c ac3_fixed -b 128k -f ac3 -flags bi
+ fate-ac3-fixed-encode: CMP = oneline
+ fate-ac3-fixed-encode: REF = a1d1fc116463b771abf5aef7ed37d7b1
+
+-FATE_SAMPLES_AVCONV- += $(FATE_AC3-yes) $(FATE_EAC3-yes)
++FATE_SAMPLES_AVCONV += $(FATE_AC3-yes) $(FATE_EAC3-yes)
+
+ fate-ac3: $(FATE_AC3-yes) $(FATE_EAC3-yes)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0105-lavc-move-SANE_NB_CHANNELS-to-internal.h-and-use-it-.patch b/debian/patches/post-9beta2/0105-lavc-move-SANE_NB_CHANNELS-to-internal.h-and-use-it-.patch
new file mode 100644
index 0000000..a4003ba
--- /dev/null
+++ b/debian/patches/post-9beta2/0105-lavc-move-SANE_NB_CHANNELS-to-internal.h-and-use-it-.patch
@@ -0,0 +1,73 @@
+From bb6941af2afd057c3897afb78d034de2c355b8a0 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 13:40:10 -0400
+Subject: [PATCH 105/204] lavc: move SANE_NB_CHANNELS to internal.h and use it
+ in the PCM decoders
+
+---
+ libavcodec/internal.h | 2 ++
+ libavcodec/pcm.c | 6 ++----
+ libavcodec/utils.c | 3 +--
+ 3 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/libavcodec/internal.h b/libavcodec/internal.h
+index e5b1958..231d4b6 100644
+--- a/libavcodec/internal.h
++++ b/libavcodec/internal.h
+@@ -30,6 +30,8 @@
+ #include "libavutil/pixfmt.h"
+ #include "avcodec.h"
+
++#define FF_SANE_NB_CHANNELS 128U
++
+ typedef struct InternalBuffer {
+ uint8_t *base[AV_NUM_DATA_POINTERS];
+ uint8_t *data[AV_NUM_DATA_POINTERS];
+diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
+index 1f8f22d..832cb43 100644
+--- a/libavcodec/pcm.c
++++ b/libavcodec/pcm.c
+@@ -31,8 +31,6 @@
+ #include "mathops.h"
+ #include "pcm_tablegen.h"
+
+-#define MAX_CHANNELS 64
+-
+ static av_cold int pcm_encode_init(AVCodecContext *avctx)
+ {
+ avctx->frame_size = 0;
+@@ -210,7 +208,7 @@ static av_cold int pcm_decode_init(AVCodecContext *avctx)
+ PCMDecode *s = avctx->priv_data;
+ int i;
+
+- if (avctx->channels <= 0 || avctx->channels > MAX_CHANNELS) {
++ if (avctx->channels <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
+ return AVERROR(EINVAL);
+ }
+@@ -340,7 +338,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
+ break;
+ case AV_CODEC_ID_PCM_S16LE_PLANAR:
+ {
+- const uint8_t *src2[MAX_CHANNELS];
++ const uint8_t *src2[FF_SANE_NB_CHANNELS];
+ n /= avctx->channels;
+ for (c = 0; c < avctx->channels; c++)
+ src2[c] = &src[c * n * 2];
+diff --git a/libavcodec/utils.c b/libavcodec/utils.c
+index 8daacbe..b4e7ed6 100644
+--- a/libavcodec/utils.c
++++ b/libavcodec/utils.c
+@@ -758,8 +758,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
+ if (av_codec_is_decoder(codec))
+ av_freep(&avctx->subtitle_header);
+
+-#define SANE_NB_CHANNELS 128U
+- if (avctx->channels > SANE_NB_CHANNELS) {
++ if (avctx->channels > FF_SANE_NB_CHANNELS) {
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0106-lavc-check-channel-count-after-decoder-init.patch b/debian/patches/post-9beta2/0106-lavc-check-channel-count-after-decoder-init.patch
new file mode 100644
index 0000000..269f13b
--- /dev/null
+++ b/debian/patches/post-9beta2/0106-lavc-check-channel-count-after-decoder-init.patch
@@ -0,0 +1,31 @@
+From 0366664ef9af85ee052925f9a1a853d14d2f47a7 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 00:56:00 -0400
+Subject: [PATCH 106/204] lavc: check channel count after decoder init
+
+Ensures the decoder did not set channel count to an insanely high value
+during initialization, which could cause large memory usage when it tries to
+get a buffer during decoding.
+---
+ libavcodec/utils.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libavcodec/utils.c b/libavcodec/utils.c
+index b4e7ed6..58dfe97 100644
+--- a/libavcodec/utils.c
++++ b/libavcodec/utils.c
+@@ -881,6 +881,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
+ avctx->channel_layout = 0;
+ }
+ }
++ if (avctx->channels && avctx->channels < 0 ||
++ avctx->channels > FF_SANE_NB_CHANNELS) {
++ ret = AVERROR(EINVAL);
++ goto free_and_end;
++ }
+ }
+ end:
+ entangled_thread_counter--;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0107-dca_parser-allow-the-parser-to-change-the-sample-rat.patch b/debian/patches/post-9beta2/0107-dca_parser-allow-the-parser-to-change-the-sample-rat.patch
new file mode 100644
index 0000000..ba2b180
--- /dev/null
+++ b/debian/patches/post-9beta2/0107-dca_parser-allow-the-parser-to-change-the-sample-rat.patch
@@ -0,0 +1,27 @@
+From a4202003b21ee88c82eec909a0ad086b4c328903 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 7 Oct 2012 20:52:35 -0400
+Subject: [PATCH 107/204] dca_parser: allow the parser to change the sample
+ rate
+
+---
+ libavcodec/dca_parser.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c
+index 7e65d0b..ab235cf 100644
+--- a/libavcodec/dca_parser.c
++++ b/libavcodec/dca_parser.c
+@@ -192,8 +192,7 @@ static int dca_parse(AVCodecParserContext * s,
+ /* read the duration and sample rate from the frame header */
+ if (!dca_parse_params(buf, buf_size, &duration, &sample_rate)) {
+ s->duration = duration;
+- if (!avctx->sample_rate)
+- avctx->sample_rate = sample_rate;
++ avctx->sample_rate = sample_rate;
+ } else
+ s->duration = 0;
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0108-amrnbdec-set-channels-channel_layout-and-sample_rate.patch b/debian/patches/post-9beta2/0108-amrnbdec-set-channels-channel_layout-and-sample_rate.patch
new file mode 100644
index 0000000..c33dcd0
--- /dev/null
+++ b/debian/patches/post-9beta2/0108-amrnbdec-set-channels-channel_layout-and-sample_rate.patch
@@ -0,0 +1,43 @@
+From b24a4449a5ae84fc73e12c47e35d19c06a8bfdf3 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 7 Oct 2012 21:17:45 -0400
+Subject: [PATCH 108/204] amrnbdec: set channels, channel_layout, and
+ sample_rate
+
+Only mono 8kHz is supported.
+---
+ libavcodec/amrnbdec.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
+index 2cb06a6..2196645 100644
+--- a/libavcodec/amrnbdec.c
++++ b/libavcodec/amrnbdec.c
+@@ -43,6 +43,7 @@
+ #include <string.h>
+ #include <math.h>
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "dsputil.h"
+ #include "libavutil/common.h"
+@@ -154,7 +155,15 @@ static av_cold int amrnb_decode_init(AVCodecContext *avctx)
+ AMRContext *p = avctx->priv_data;
+ int i;
+
+- avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
++ if (avctx->channels > 1) {
++ av_log_missing_feature(avctx, "multi-channel AMR", 0);
++ return AVERROR_PATCHWELCOME;
++ }
++
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_rate = 8000;
++ avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+
+ // p->excitation always points to the same position in p->excitation_buf
+ p->excitation = &p->excitation_buf[PITCH_DELAY_MAX + LP_FILTER_ORDER + 1];
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0109-amrwbdec-set-channels-channel_layout-and-sample_rate.patch b/debian/patches/post-9beta2/0109-amrwbdec-set-channels-channel_layout-and-sample_rate.patch
new file mode 100644
index 0000000..205450d
--- /dev/null
+++ b/debian/patches/post-9beta2/0109-amrwbdec-set-channels-channel_layout-and-sample_rate.patch
@@ -0,0 +1,43 @@
+From ee0e9678e761e8a41cfffcb163de42967e5a1758 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 7 Oct 2012 21:19:28 -0400
+Subject: [PATCH 109/204] amrwbdec: set channels, channel_layout, and
+ sample_rate
+
+Only mono 16kHz is supported.
+---
+ libavcodec/amrwbdec.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
+index c9c793f..9b0fe25 100644
+--- a/libavcodec/amrwbdec.c
++++ b/libavcodec/amrwbdec.c
+@@ -24,6 +24,7 @@
+ * AMR wideband decoder
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/common.h"
+ #include "libavutil/lfg.h"
+
+@@ -90,7 +91,15 @@ static av_cold int amrwb_decode_init(AVCodecContext *avctx)
+ AMRWBContext *ctx = avctx->priv_data;
+ int i;
+
+- avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
++ if (avctx->channels > 1) {
++ av_log_missing_feature(avctx, "multi-channel AMR", 0);
++ return AVERROR_PATCHWELCOME;
++ }
++
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_rate = 16000;
++ avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+
+ av_lfg_init(&ctx->prng, 1);
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0110-g722dec-set-channel-layout-at-initialization-instead.patch b/debian/patches/post-9beta2/0110-g722dec-set-channel-layout-at-initialization-instead.patch
new file mode 100644
index 0000000..9417c37
--- /dev/null
+++ b/debian/patches/post-9beta2/0110-g722dec-set-channel-layout-at-initialization-instead.patch
@@ -0,0 +1,40 @@
+From ec2694d25905c217e5815947cda896aa25398388 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 15 Oct 2012 16:40:44 -0400
+Subject: [PATCH 110/204] g722dec: set channel layout at initialization
+ instead of validating it
+
+---
+ libavcodec/g722dec.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c
+index ea06ce0..3364850 100644
+--- a/libavcodec/g722dec.c
++++ b/libavcodec/g722dec.c
+@@ -34,6 +34,7 @@
+ * respectively of each byte are ignored.
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "get_bits.h"
+ #include "g722.h"
+@@ -57,11 +58,9 @@ static av_cold int g722_decode_init(AVCodecContext * avctx)
+ {
+ G722Context *c = avctx->priv_data;
+
+- if (avctx->channels != 1) {
+- av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n");
+- return AVERROR_INVALIDDATA;
+- }
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ c->band[0].scale_factor = 8;
+ c->band[1].scale_factor = 2;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0111-dsicinaudio-set-channels-and-channel-layout.patch b/debian/patches/post-9beta2/0111-dsicinaudio-set-channels-and-channel-layout.patch
new file mode 100644
index 0000000..7e4f078
--- /dev/null
+++ b/debian/patches/post-9beta2/0111-dsicinaudio-set-channels-and-channel-layout.patch
@@ -0,0 +1,43 @@
+From 4f56f9c48f40db7f84819fc923b79ddaac678ae7 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Wed, 17 Oct 2012 11:29:04 -0400
+Subject: [PATCH 111/204] dsicinaudio: set channels and channel layout
+
+---
+ libavcodec/dsicinav.c | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c
+index 1492717..2dcbf74 100644
+--- a/libavcodec/dsicinav.c
++++ b/libavcodec/dsicinav.c
+@@ -24,6 +24,7 @@
+ * Delphine Software International CIN audio/video decoders
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "bytestream.h"
+ #include "mathops.h"
+@@ -319,14 +320,11 @@ static av_cold int cinaudio_decode_init(AVCodecContext *avctx)
+ {
+ CinAudioContext *cin = avctx->priv_data;
+
+- if (avctx->channels != 1) {
+- av_log_ask_for_sample(avctx, "Number of channels is not supported\n");
+- return AVERROR_PATCHWELCOME;
+- }
+-
+ cin->initial_decode_frame = 1;
+- cin->delta = 0;
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ cin->delta = 0;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
+
+ avcodec_get_frame_defaults(&cin->frame);
+ avctx->coded_frame = &cin->frame;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0112-atrac1-do-not-keep-a-copy-of-channel-count-in-the-pr.patch b/debian/patches/post-9beta2/0112-atrac1-do-not-keep-a-copy-of-channel-count-in-the-pr.patch
new file mode 100644
index 0000000..126db74
--- /dev/null
+++ b/debian/patches/post-9beta2/0112-atrac1-do-not-keep-a-copy-of-channel-count-in-the-pr.patch
@@ -0,0 +1,51 @@
+From a38eadf7ed08293667c9f81780f7c081f278f19a Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Wed, 17 Oct 2012 11:45:49 -0400
+Subject: [PATCH 112/204] atrac1: do not keep a copy of channel count in the
+ private context
+
+---
+ libavcodec/atrac1.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
+index 7e78c73..b746a54 100644
+--- a/libavcodec/atrac1.c
++++ b/libavcodec/atrac1.c
+@@ -80,7 +80,6 @@ typedef struct {
+ DECLARE_ALIGNED(32, float, high)[512];
+ float* bands[3];
+ FFTContext mdct_ctx[3];
+- int channels;
+ DSPContext dsp;
+ } AT1Ctx;
+
+@@ -280,7 +279,7 @@ static int atrac1_decode_frame(AVCodecContext *avctx, void *data,
+ GetBitContext gb;
+
+
+- if (buf_size < 212 * q->channels) {
++ if (buf_size < 212 * avctx->channels) {
+ av_log(avctx, AV_LOG_ERROR, "Not enough data to decode!\n");
+ return AVERROR_INVALIDDATA;
+ }
+@@ -292,7 +291,7 @@ static int atrac1_decode_frame(AVCodecContext *avctx, void *data,
+ return ret;
+ }
+
+- for (ch = 0; ch < q->channels; ch++) {
++ for (ch = 0; ch < avctx->channels; ch++) {
+ AT1SUCtx* su = &q->SUs[ch];
+
+ init_get_bits(&gb, &buf[212 * ch], 212 * 8);
+@@ -343,7 +342,6 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
+ avctx->channels);
+ return AVERROR(EINVAL);
+ }
+- q->channels = avctx->channels;
+
+ /* Init the mdct transforms */
+ if ((ret = ff_mdct_init(&q->mdct_ctx[0], 6, 1, -1.0/ (1 << 15))) ||
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0113-bmvaudio-set-channel-layout-at-init-rather-than-vali.patch b/debian/patches/post-9beta2/0113-bmvaudio-set-channel-layout-at-init-rather-than-vali.patch
new file mode 100644
index 0000000..a73e03a
--- /dev/null
+++ b/debian/patches/post-9beta2/0113-bmvaudio-set-channel-layout-at-init-rather-than-vali.patch
@@ -0,0 +1,41 @@
+From a3145d0335b04d143c26832c91dcc7242c758206 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 13:48:50 -0400
+Subject: [PATCH 113/204] bmvaudio: set channel layout at init() rather than
+ validating it
+
+---
+ libavcodec/bmv.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c
+index 4611119..53781e7 100644
+--- a/libavcodec/bmv.c
++++ b/libavcodec/bmv.c
+@@ -19,6 +19,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "bytestream.h"
+
+@@ -304,12 +305,9 @@ static av_cold int bmv_aud_decode_init(AVCodecContext *avctx)
+ {
+ BMVAudioDecContext *c = avctx->priv_data;
+
+- if (avctx->channels != 2) {
+- av_log(avctx, AV_LOG_INFO, "invalid number of channels\n");
+- return AVERROR(EINVAL);
+- }
+-
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 2;
++ avctx->channel_layout = AV_CH_LAYOUT_STEREO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ avcodec_get_frame_defaults(&c->frame);
+ avctx->coded_frame = &c->frame;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0114-cook-use-AVCodecContext.channels-instead-of-keeping-.patch b/debian/patches/post-9beta2/0114-cook-use-AVCodecContext.channels-instead-of-keeping-.patch
new file mode 100644
index 0000000..f074339
--- /dev/null
+++ b/debian/patches/post-9beta2/0114-cook-use-AVCodecContext.channels-instead-of-keeping-.patch
@@ -0,0 +1,79 @@
+From 3509eee19c03c23a14c6f226e6cc90072f323025 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 14:24:04 -0400
+Subject: [PATCH 114/204] cook: use AVCodecContext.channels instead of keeping
+ a private copy
+
+---
+ libavcodec/cook.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index a45bd80..8323bbe 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -126,7 +126,6 @@ typedef struct cook {
+ AVFrame frame;
+ GetBitContext gb;
+ /* stream data */
+- int nb_channels;
+ int bit_rate;
+ int sample_rate;
+ int num_vectors;
+@@ -1024,7 +1023,7 @@ static void dump_cook_context(COOKContext *q)
+ PRINT("js_vlc_bits", q->subpacket[0].js_vlc_bits);
+ }
+ av_log(q->avctx, AV_LOG_ERROR, "COOKContext\n");
+- PRINT("nb_channels", q->nb_channels);
++ PRINT("nb_channels", q->avctx->channels);
+ PRINT("bit_rate", q->bit_rate);
+ PRINT("sample_rate", q->sample_rate);
+ PRINT("samples_per_channel", q->subpacket[0].samples_per_channel);
+@@ -1072,9 +1071,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+
+ /* Take data from the AVCodecContext (RM container). */
+ q->sample_rate = avctx->sample_rate;
+- q->nb_channels = avctx->channels;
+ q->bit_rate = avctx->bit_rate;
+- if (!q->nb_channels) {
++ if (!avctx->channels) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
+ return AVERROR_INVALIDDATA;
+ }
+@@ -1101,7 +1099,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ }
+
+ /* Initialize extradata related variables. */
+- q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame / q->nb_channels;
++ q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame / avctx->channels;
+ q->subpacket[s].bits_per_subpacket = avctx->block_align * 8;
+
+ /* Initialize default data states. */
+@@ -1116,21 +1114,21 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ q->subpacket[s].joint_stereo = 0;
+ switch (q->subpacket[s].cookversion) {
+ case MONO:
+- if (q->nb_channels != 1) {
++ if (avctx->channels != 1) {
+ av_log_ask_for_sample(avctx, "Container channels != 1.\n");
+ return AVERROR_PATCHWELCOME;
+ }
+ av_log(avctx, AV_LOG_DEBUG, "MONO\n");
+ break;
+ case STEREO:
+- if (q->nb_channels != 1) {
++ if (avctx->channels != 1) {
+ q->subpacket[s].bits_per_subpdiv = 1;
+ q->subpacket[s].num_channels = 2;
+ }
+ av_log(avctx, AV_LOG_DEBUG, "STEREO\n");
+ break;
+ case JOINT_STEREO:
+- if (q->nb_channels != 2) {
++ if (avctx->channels != 2) {
+ av_log_ask_for_sample(avctx, "Container channels != 2.\n");
+ return AVERROR_PATCHWELCOME;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0115-cook-remove-unneeded-COOKContext-variable-bit_rate.patch b/debian/patches/post-9beta2/0115-cook-remove-unneeded-COOKContext-variable-bit_rate.patch
new file mode 100644
index 0000000..0ccfc01
--- /dev/null
+++ b/debian/patches/post-9beta2/0115-cook-remove-unneeded-COOKContext-variable-bit_rate.patch
@@ -0,0 +1,41 @@
+From 8aa5b8c5c825a86449774f6023400b4775c25027 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 14:25:18 -0400
+Subject: [PATCH 115/204] cook: remove unneeded COOKContext variable, bit_rate
+
+---
+ libavcodec/cook.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index 8323bbe..7467749 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -126,7 +126,6 @@ typedef struct cook {
+ AVFrame frame;
+ GetBitContext gb;
+ /* stream data */
+- int bit_rate;
+ int sample_rate;
+ int num_vectors;
+ int samples_per_channel;
+@@ -1024,7 +1023,7 @@ static void dump_cook_context(COOKContext *q)
+ }
+ av_log(q->avctx, AV_LOG_ERROR, "COOKContext\n");
+ PRINT("nb_channels", q->avctx->channels);
+- PRINT("bit_rate", q->bit_rate);
++ PRINT("bit_rate", q->avctx->bit_rate);
+ PRINT("sample_rate", q->sample_rate);
+ PRINT("samples_per_channel", q->subpacket[0].samples_per_channel);
+ PRINT("samples_per_frame", q->subpacket[0].samples_per_frame);
+@@ -1071,7 +1070,6 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+
+ /* Take data from the AVCodecContext (RM container). */
+ q->sample_rate = avctx->sample_rate;
+- q->bit_rate = avctx->bit_rate;
+ if (!avctx->channels) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
+ return AVERROR_INVALIDDATA;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0116-cook-remove-unneeded-COOKContext-variable-sample_rat.patch b/debian/patches/post-9beta2/0116-cook-remove-unneeded-COOKContext-variable-sample_rat.patch
new file mode 100644
index 0000000..a416557
--- /dev/null
+++ b/debian/patches/post-9beta2/0116-cook-remove-unneeded-COOKContext-variable-sample_rat.patch
@@ -0,0 +1,42 @@
+From 926e9d28f1a85898545706a26b27c24672c9c716 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 14:26:29 -0400
+Subject: [PATCH 116/204] cook: remove unneeded COOKContext variable,
+ sample_rate
+
+---
+ libavcodec/cook.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index 7467749..f6d2e66 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -126,7 +126,6 @@ typedef struct cook {
+ AVFrame frame;
+ GetBitContext gb;
+ /* stream data */
+- int sample_rate;
+ int num_vectors;
+ int samples_per_channel;
+ /* states */
+@@ -1024,7 +1023,7 @@ static void dump_cook_context(COOKContext *q)
+ av_log(q->avctx, AV_LOG_ERROR, "COOKContext\n");
+ PRINT("nb_channels", q->avctx->channels);
+ PRINT("bit_rate", q->avctx->bit_rate);
+- PRINT("sample_rate", q->sample_rate);
++ PRINT("sample_rate", q->avctx->sample_rate);
+ PRINT("samples_per_channel", q->subpacket[0].samples_per_channel);
+ PRINT("samples_per_frame", q->subpacket[0].samples_per_frame);
+ PRINT("subbands", q->subpacket[0].subbands);
+@@ -1069,7 +1068,6 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ av_log(avctx, AV_LOG_DEBUG, "codecdata_length=%d\n", avctx->extradata_size);
+
+ /* Take data from the AVCodecContext (RM container). */
+- q->sample_rate = avctx->sample_rate;
+ if (!avctx->channels) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
+ return AVERROR_INVALIDDATA;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0117-cook-reverse-a-condition-so-that-the-code-makes-more.patch b/debian/patches/post-9beta2/0117-cook-reverse-a-condition-so-that-the-code-makes-more.patch
new file mode 100644
index 0000000..7174ce8
--- /dev/null
+++ b/debian/patches/post-9beta2/0117-cook-reverse-a-condition-so-that-the-code-makes-more.patch
@@ -0,0 +1,29 @@
+From d21b2e4726822ec1c604e2b9010a1a2cc0d88aec Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 14:33:11 -0400
+Subject: [PATCH 117/204] cook: reverse a condition so that the code makes
+ more sense
+
+---
+ libavcodec/cook.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index f6d2e66..211fe12 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -1244,9 +1244,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ }
+
+ /* Try to catch some obviously faulty streams, othervise it might be exploitable */
+- if ((q->samples_per_channel == 256) || (q->samples_per_channel == 512)
+- || (q->samples_per_channel == 1024)) {
+- } else {
++ if (q->samples_per_channel != 256 && q->samples_per_channel != 512 &&
++ q->samples_per_channel != 1024) {
+ av_log_ask_for_sample(avctx,
+ "unknown amount of samples_per_channel = %d\n",
+ q->samples_per_channel);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0118-cook-use-av_get_channel_layout_nb_channels-instead-o.patch b/debian/patches/post-9beta2/0118-cook-use-av_get_channel_layout_nb_channels-instead-o.patch
new file mode 100644
index 0000000..93e2610
--- /dev/null
+++ b/debian/patches/post-9beta2/0118-cook-use-av_get_channel_layout_nb_channels-instead-o.patch
@@ -0,0 +1,43 @@
+From 7efbba2e3665285207bf769b8f0d712cedf1bfd9 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 14:36:38 -0400
+Subject: [PATCH 118/204] cook: use av_get_channel_layout_nb_channels()
+ instead of cook_count_channels()
+
+---
+ libavcodec/cook.c | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index 211fe12..1524719 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -1034,16 +1034,6 @@ static void dump_cook_context(COOKContext *q)
+ }
+ #endif
+
+-static av_cold int cook_count_channels(unsigned int mask)
+-{
+- int i;
+- int channels = 0;
+- for (i = 0; i < 32; i++)
+- if (mask & (1 << i))
+- ++channels;
+- return channels;
+-}
+-
+ /**
+ * Cook initialization
+ *
+@@ -1147,7 +1137,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ if (extradata_size >= 4)
+ channel_mask |= q->subpacket[s].channel_mask = bytestream_get_be32(&edata_ptr);
+
+- if (cook_count_channels(q->subpacket[s].channel_mask) > 1) {
++ if (av_get_channel_layout_nb_channels(q->subpacket[s].channel_mask) > 1) {
+ q->subpacket[s].total_subbands = q->subpacket[s].subbands +
+ q->subpacket[s].js_subband_start;
+ q->subpacket[s].joint_stereo = 1;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0119-cook-move-samples_per_frame-from-COOKSubpacket-to-wh.patch b/debian/patches/post-9beta2/0119-cook-move-samples_per_frame-from-COOKSubpacket-to-wh.patch
new file mode 100644
index 0000000..8aef5e2
--- /dev/null
+++ b/debian/patches/post-9beta2/0119-cook-move-samples_per_frame-from-COOKSubpacket-to-wh.patch
@@ -0,0 +1,77 @@
+From 8f173ef019d7e8921ab2cb094718f14e8c016a59 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 14:43:02 -0400
+Subject: [PATCH 119/204] cook: move samples_per_frame from COOKSubpacket to
+ where it is used
+
+---
+ libavcodec/cook.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index 1524719..ed8eaf3 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -72,7 +72,6 @@ typedef struct {
+ int size;
+ int num_channels;
+ int cookversion;
+- int samples_per_frame;
+ int subbands;
+ int js_subband_start;
+ int js_vlc_bits;
+@@ -1025,7 +1024,6 @@ static void dump_cook_context(COOKContext *q)
+ PRINT("bit_rate", q->avctx->bit_rate);
+ PRINT("sample_rate", q->avctx->sample_rate);
+ PRINT("samples_per_channel", q->subpacket[0].samples_per_channel);
+- PRINT("samples_per_frame", q->subpacket[0].samples_per_frame);
+ PRINT("subbands", q->subpacket[0].subbands);
+ PRINT("js_subband_start", q->subpacket[0].js_subband_start);
+ PRINT("log2_numvector_size", q->subpacket[0].log2_numvector_size);
+@@ -1047,6 +1045,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ int extradata_size = avctx->extradata_size;
+ int s = 0;
+ unsigned int channel_mask = 0;
++ int samples_per_frame;
+ int ret;
+ q->avctx = avctx;
+
+@@ -1073,7 +1072,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ Swap to right endianness so we don't need to care later on. */
+ if (extradata_size >= 8) {
+ q->subpacket[s].cookversion = bytestream_get_be32(&edata_ptr);
+- q->subpacket[s].samples_per_frame = bytestream_get_be16(&edata_ptr);
++ samples_per_frame = bytestream_get_be16(&edata_ptr);
+ q->subpacket[s].subbands = bytestream_get_be16(&edata_ptr);
+ extradata_size -= 8;
+ }
+@@ -1085,7 +1084,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ }
+
+ /* Initialize extradata related variables. */
+- q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame / avctx->channels;
++ q->subpacket[s].samples_per_channel = samples_per_frame / avctx->channels;
+ q->subpacket[s].bits_per_subpacket = avctx->block_align * 8;
+
+ /* Initialize default data states. */
+@@ -1142,7 +1141,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ q->subpacket[s].js_subband_start;
+ q->subpacket[s].joint_stereo = 1;
+ q->subpacket[s].num_channels = 2;
+- q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame >> 1;
++ q->subpacket[s].samples_per_channel = samples_per_frame >> 1;
+
+ if (q->subpacket[s].samples_per_channel > 256) {
+ q->subpacket[s].log2_numvector_size = 6;
+@@ -1151,7 +1150,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
+ q->subpacket[s].log2_numvector_size = 7;
+ }
+ } else
+- q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame;
++ q->subpacket[s].samples_per_channel = samples_per_frame;
+
+ break;
+ default:
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0120-cook-use-av_dlog-for-debug-logging-instead-of-av_log.patch b/debian/patches/post-9beta2/0120-cook-use-av_dlog-for-debug-logging-instead-of-av_log.patch
new file mode 100644
index 0000000..a29c879
--- /dev/null
+++ b/debian/patches/post-9beta2/0120-cook-use-av_dlog-for-debug-logging-instead-of-av_log.patch
@@ -0,0 +1,36 @@
+From 93e27f86f161ca5ed811be3570289a4f972862dc Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 14:47:10 -0400
+Subject: [PATCH 120/204] cook: use av_dlog() for debug logging instead of
+ av_log() with AV_LOG_ERROR
+
+---
+ libavcodec/cook.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libavcodec/cook.c b/libavcodec/cook.c
+index ed8eaf3..201b44c 100644
+--- a/libavcodec/cook.c
++++ b/libavcodec/cook.c
+@@ -1012,14 +1012,14 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
+ static void dump_cook_context(COOKContext *q)
+ {
+ //int i=0;
+-#define PRINT(a, b) av_log(q->avctx, AV_LOG_ERROR, " %s = %d\n", a, b);
+- av_log(q->avctx, AV_LOG_ERROR, "COOKextradata\n");
+- av_log(q->avctx, AV_LOG_ERROR, "cookversion=%x\n", q->subpacket[0].cookversion);
++#define PRINT(a, b) av_dlog(q->avctx, " %s = %d\n", a, b);
++ av_dlog(q->avctx, "COOKextradata\n");
++ av_dlog(q->avctx, "cookversion=%x\n", q->subpacket[0].cookversion);
+ if (q->subpacket[0].cookversion > STEREO) {
+ PRINT("js_subband_start", q->subpacket[0].js_subband_start);
+ PRINT("js_vlc_bits", q->subpacket[0].js_vlc_bits);
+ }
+- av_log(q->avctx, AV_LOG_ERROR, "COOKContext\n");
++ av_dlog(q->avctx, "COOKContext\n");
+ PRINT("nb_channels", q->avctx->channels);
+ PRINT("bit_rate", q->avctx->bit_rate);
+ PRINT("sample_rate", q->avctx->sample_rate);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0121-dcadec-allow-the-decoder-to-change-the-channel-layou.patch b/debian/patches/post-9beta2/0121-dcadec-allow-the-decoder-to-change-the-channel-layou.patch
new file mode 100644
index 0000000..7d3b80b
--- /dev/null
+++ b/debian/patches/post-9beta2/0121-dcadec-allow-the-decoder-to-change-the-channel-layou.patch
@@ -0,0 +1,49 @@
+From 8ac0f6767bf63d3e6b308ee6648ff02598b81e03 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 15:12:36 -0400
+Subject: [PATCH 121/204] dcadec: allow the decoder to change the channel
+ layout mid-stream
+
+---
+ libavcodec/dcadec.c | 18 +-----------------
+ 1 file changed, 1 insertion(+), 17 deletions(-)
+
+diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
+index eb12eb2..026c572 100644
+--- a/libavcodec/dcadec.c
++++ b/libavcodec/dcadec.c
+@@ -317,7 +317,6 @@ typedef struct {
+
+ /* Primary audio coding header */
+ int subframes; ///< number of subframes
+- int is_channels_set; ///< check for if the channel number is already set
+ int total_channels; ///< number of channels including extensions
+ int prim_channels; ///< number of primary audio channels
+ int subband_activity[DCA_PRIM_CHANNELS_MAX]; ///< subband activity count
+@@ -1831,22 +1830,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
+ av_log(avctx, AV_LOG_ERROR, "Non standard configuration %d !\n", s->amode);
+ return AVERROR_INVALIDDATA;
+ }
+-
+-
+- /* There is nothing that prevents a dts frame to change channel configuration
+- but Libav doesn't support that so only set the channels if it is previously
+- unset. Ideally during the first probe for channels the crc should be checked
+- and only set avctx->channels when the crc is ok. Right now the decoder could
+- set the channels based on a broken first frame.*/
+- if (s->is_channels_set == 0) {
+- s->is_channels_set = 1;
+- avctx->channels = channels;
+- }
+- if (avctx->channels != channels) {
+- av_log(avctx, AV_LOG_ERROR, "DCA decoder does not support number of "
+- "channels changing in stream. Skipping frame.\n");
+- return AVERROR_PATCHWELCOME;
+- }
++ avctx->channels = channels;
+
+ /* get output buffer */
+ s->frame.nb_samples = 256 * (s->sample_blocks / 8);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0122-flacdec-use-av_samples_-functions-for-sample-buffer-.patch b/debian/patches/post-9beta2/0122-flacdec-use-av_samples_-functions-for-sample-buffer-.patch
new file mode 100644
index 0000000..8396349
--- /dev/null
+++ b/debian/patches/post-9beta2/0122-flacdec-use-av_samples_-functions-for-sample-buffer-.patch
@@ -0,0 +1,129 @@
+From 268f8ba112570956f1d7be8f4f2f0bea86c61461 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 16:15:34 -0400
+Subject: [PATCH 122/204] flacdec: use av_samples_* functions for sample
+ buffer allocation
+
+Also, return an error on allocation failure.
+---
+ libavcodec/flacdec.c | 43 +++++++++++++++++++++++++++++--------------
+ 1 file changed, 29 insertions(+), 14 deletions(-)
+
+diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
+index a1fdc35..4ecf5f2 100644
+--- a/libavcodec/flacdec.c
++++ b/libavcodec/flacdec.c
+@@ -60,6 +60,8 @@ typedef struct FLACContext {
+ int got_streaminfo; ///< indicates if the STREAMINFO has been read
+
+ int32_t *decoded[FLAC_MAX_CHANNELS]; ///< decoded samples
++ uint8_t *decoded_buffer;
++ unsigned int decoded_buffer_size;
+
+ FLACDSPContext dsp;
+ } FLACContext;
+@@ -73,7 +75,7 @@ static const int64_t flac_channel_layouts[6] = {
+ AV_CH_LAYOUT_5POINT1
+ };
+
+-static void allocate_buffers(FLACContext *s);
++static int allocate_buffers(FLACContext *s);
+
+ static void flac_set_bps(FLACContext *s)
+ {
+@@ -101,6 +103,7 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
+ {
+ enum FLACExtradataFormat format;
+ uint8_t *streaminfo;
++ int ret;
+ FLACContext *s = avctx->priv_data;
+ s->avctx = avctx;
+
+@@ -114,7 +117,9 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
+
+ /* initialize based on the demuxer-supplied streamdata header */
+ avpriv_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo);
+- allocate_buffers(s);
++ ret = allocate_buffers(s);
++ if (ret < 0)
++ return ret;
+ flac_set_bps(s);
+ ff_flacdsp_init(&s->dsp, avctx->sample_fmt, s->bps);
+ s->got_streaminfo = 1;
+@@ -137,15 +142,24 @@ static void dump_headers(AVCodecContext *avctx, FLACStreaminfo *s)
+ av_log(avctx, AV_LOG_DEBUG, " Bits: %d\n", s->bps);
+ }
+
+-static void allocate_buffers(FLACContext *s)
++static int allocate_buffers(FLACContext *s)
+ {
+- int i;
++ int buf_size;
+
+ assert(s->max_blocksize);
+
+- for (i = 0; i < s->channels; i++) {
+- s->decoded[i] = av_malloc(sizeof(int32_t)*s->max_blocksize);
+- }
++ buf_size = av_samples_get_buffer_size(NULL, s->channels, s->max_blocksize,
++ AV_SAMPLE_FMT_S32P, 0);
++ if (buf_size < 0)
++ return buf_size;
++
++ av_fast_malloc(&s->decoded_buffer, &s->decoded_buffer_size, buf_size);
++ if (!s->decoded_buffer)
++ return AVERROR(ENOMEM);
++
++ return av_samples_fill_arrays((uint8_t **)s->decoded, NULL,
++ s->decoded_buffer, s->channels,
++ s->max_blocksize, AV_SAMPLE_FMT_S32P, 0);
+ }
+
+ /**
+@@ -157,7 +171,7 @@ static void allocate_buffers(FLACContext *s)
+ */
+ static int parse_streaminfo(FLACContext *s, const uint8_t *buf, int buf_size)
+ {
+- int metadata_type, metadata_size;
++ int metadata_type, metadata_size, ret;
+
+ if (buf_size < FLAC_STREAMINFO_SIZE+8) {
+ /* need more data */
+@@ -169,7 +183,9 @@ static int parse_streaminfo(FLACContext *s, const uint8_t *buf, int buf_size)
+ return AVERROR_INVALIDDATA;
+ }
+ avpriv_flac_parse_streaminfo(s->avctx, (FLACStreaminfo *)s, &buf[8]);
+- allocate_buffers(s);
++ ret = allocate_buffers(s);
++ if (ret < 0)
++ return ret;
+ flac_set_bps(s);
+ ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
+ s->got_streaminfo = 1;
+@@ -462,7 +478,9 @@ static int decode_frame(FLACContext *s)
+ s->samplerate = s->avctx->sample_rate = fi.samplerate;
+
+ if (!s->got_streaminfo) {
+- allocate_buffers(s);
++ int ret = allocate_buffers(s);
++ if (ret < 0)
++ return ret;
+ ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
+ s->got_streaminfo = 1;
+ dump_headers(s->avctx, (FLACStreaminfo *)s);
+@@ -552,11 +570,8 @@ static int flac_decode_frame(AVCodecContext *avctx, void *data,
+ static av_cold int flac_decode_close(AVCodecContext *avctx)
+ {
+ FLACContext *s = avctx->priv_data;
+- int i;
+
+- for (i = 0; i < s->channels; i++) {
+- av_freep(&s->decoded[i]);
+- }
++ av_freep(&s->decoded_buffer);
+
+ return 0;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0123-flacdec-allow-mid-stream-channel-layout-change.patch b/debian/patches/post-9beta2/0123-flacdec-allow-mid-stream-channel-layout-change.patch
new file mode 100644
index 0000000..1bf64bb
--- /dev/null
+++ b/debian/patches/post-9beta2/0123-flacdec-allow-mid-stream-channel-layout-change.patch
@@ -0,0 +1,160 @@
+From 90fcac0e95b7d266c148a86506f301a2072d9de3 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 17:02:28 -0400
+Subject: [PATCH 123/204] flacdec: allow mid-stream channel layout change
+
+Although the libFLAC decoder cannot handle such a change, it is allowed by the
+spec and could potentially occur with live streams.
+---
+ libavcodec/flac.c | 19 +++++++++++++++++++
+ libavcodec/flac.h | 3 +++
+ libavcodec/flac_parser.c | 1 +
+ libavcodec/flacdec.c | 27 +++++++++------------------
+ 4 files changed, 32 insertions(+), 18 deletions(-)
+
+diff --git a/libavcodec/flac.c b/libavcodec/flac.c
+index d624beb..07da702 100644
+--- a/libavcodec/flac.c
++++ b/libavcodec/flac.c
+@@ -19,6 +19,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/crc.h"
+ #include "libavutil/log.h"
+ #include "bytestream.h"
+@@ -28,6 +29,15 @@
+
+ static const int8_t sample_size_table[] = { 0, 8, 12, 0, 16, 20, 24, 0 };
+
++static const int64_t flac_channel_layouts[6] = {
++ AV_CH_LAYOUT_MONO,
++ AV_CH_LAYOUT_STEREO,
++ AV_CH_LAYOUT_SURROUND,
++ AV_CH_LAYOUT_QUAD,
++ AV_CH_LAYOUT_5POINT0,
++ AV_CH_LAYOUT_5POINT1
++};
++
+ static int64_t get_utf8(GetBitContext *gb)
+ {
+ int64_t val;
+@@ -181,6 +191,14 @@ int avpriv_flac_is_extradata_valid(AVCodecContext *avctx,
+ return 1;
+ }
+
++void ff_flac_set_channel_layout(AVCodecContext *avctx)
++{
++ if (avctx->channels <= FF_ARRAY_ELEMS(flac_channel_layouts))
++ avctx->channel_layout = flac_channel_layouts[avctx->channels - 1];
++ else
++ avctx->channel_layout = 0;
++}
++
+ void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
+ const uint8_t *buffer)
+ {
+@@ -205,6 +223,7 @@ void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *
+ avctx->channels = s->channels;
+ avctx->sample_rate = s->samplerate;
+ avctx->bits_per_raw_sample = s->bps;
++ ff_flac_set_channel_layout(avctx);
+
+ s->samples = get_bits_long(&gb, 32) << 4;
+ s->samples |= get_bits(&gb, 4);
+diff --git a/libavcodec/flac.h b/libavcodec/flac.h
+index 55bacea..63f41c2 100644
+--- a/libavcodec/flac.h
++++ b/libavcodec/flac.h
+@@ -137,4 +137,7 @@ int ff_flac_get_max_frame_size(int blocksize, int ch, int bps);
+ */
+ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
+ FLACFrameInfo *fi, int log_level_offset);
++
++void ff_flac_set_channel_layout(AVCodecContext *avctx);
++
+ #endif /* AVCODEC_FLAC_H */
+diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c
+index 6c8c046..f0a37f3 100644
+--- a/libavcodec/flac_parser.c
++++ b/libavcodec/flac_parser.c
+@@ -459,6 +459,7 @@ static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf,
+
+ fpc->avctx->sample_rate = header->fi.samplerate;
+ fpc->avctx->channels = header->fi.channels;
++ ff_flac_set_channel_layout(fpc->avctx);
+ fpc->pc->duration = header->fi.blocksize;
+ *poutbuf = flac_fifo_read_wrap(fpc, header->offset, *poutbuf_size,
+ &fpc->wrap_buf,
+diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
+index 4ecf5f2..20af820 100644
+--- a/libavcodec/flacdec.c
++++ b/libavcodec/flacdec.c
+@@ -66,15 +66,6 @@ typedef struct FLACContext {
+ FLACDSPContext dsp;
+ } FLACContext;
+
+-static const int64_t flac_channel_layouts[6] = {
+- AV_CH_LAYOUT_MONO,
+- AV_CH_LAYOUT_STEREO,
+- AV_CH_LAYOUT_SURROUND,
+- AV_CH_LAYOUT_QUAD,
+- AV_CH_LAYOUT_5POINT0,
+- AV_CH_LAYOUT_5POINT1
+-};
+-
+ static int allocate_buffers(FLACContext *s);
+
+ static void flac_set_bps(FLACContext *s)
+@@ -127,9 +118,6 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
+ avcodec_get_frame_defaults(&s->frame);
+ avctx->coded_frame = &s->frame;
+
+- if (avctx->channels <= FF_ARRAY_ELEMS(flac_channel_layouts))
+- avctx->channel_layout = flac_channel_layouts[avctx->channels - 1];
+-
+ return 0;
+ }
+
+@@ -421,7 +409,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
+
+ static int decode_frame(FLACContext *s)
+ {
+- int i;
++ int i, ret;
+ GetBitContext *gb = &s->gb;
+ FLACFrameInfo fi;
+
+@@ -430,12 +418,15 @@ static int decode_frame(FLACContext *s)
+ return -1;
+ }
+
+- if (s->channels && fi.channels != s->channels) {
+- av_log(s->avctx, AV_LOG_ERROR, "switching channel layout mid-stream "
+- "is not supported\n");
+- return -1;
++ if (s->channels && fi.channels != s->channels && s->got_streaminfo) {
++ s->channels = s->avctx->channels = fi.channels;
++ ff_flac_set_channel_layout(s->avctx);
++ ret = allocate_buffers(s);
++ if (ret < 0)
++ return ret;
+ }
+ s->channels = s->avctx->channels = fi.channels;
++ ff_flac_set_channel_layout(s->avctx);
+ s->ch_mode = fi.ch_mode;
+
+ if (!s->bps && !fi.bps) {
+@@ -478,7 +469,7 @@ static int decode_frame(FLACContext *s)
+ s->samplerate = s->avctx->sample_rate = fi.samplerate;
+
+ if (!s->got_streaminfo) {
+- int ret = allocate_buffers(s);
++ ret = allocate_buffers(s);
+ if (ret < 0)
+ return ret;
+ ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0124-flacdec-do-not-warn-on-sample-rate-change.patch b/debian/patches/post-9beta2/0124-flacdec-do-not-warn-on-sample-rate-change.patch
new file mode 100644
index 0000000..edf75cd
--- /dev/null
+++ b/debian/patches/post-9beta2/0124-flacdec-do-not-warn-on-sample-rate-change.patch
@@ -0,0 +1,30 @@
+From 99d868635725e3b85a5c549e6bb0e97e10cf5248 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sun, 21 Oct 2012 17:04:58 -0400
+Subject: [PATCH 124/204] flacdec: do not warn on sample rate change
+
+---
+ libavcodec/flacdec.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
+index 20af820..10e33f2 100644
+--- a/libavcodec/flacdec.c
++++ b/libavcodec/flacdec.c
+@@ -460,12 +460,8 @@ static int decode_frame(FLACContext *s)
+ " or frame header\n");
+ return -1;
+ }
+- if (fi.samplerate == 0) {
++ if (fi.samplerate == 0)
+ fi.samplerate = s->samplerate;
+- } else if (s->samplerate && fi.samplerate != s->samplerate) {
+- av_log(s->avctx, AV_LOG_WARNING, "sample rate changed from %d to %d\n",
+- s->samplerate, fi.samplerate);
+- }
+ s->samplerate = s->avctx->sample_rate = fi.samplerate;
+
+ if (!s->got_streaminfo) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0125-g726dec-set-channel-layout-at-initialization-instead.patch b/debian/patches/post-9beta2/0125-g726dec-set-channel-layout-at-initialization-instead.patch
new file mode 100644
index 0000000..4b12e90
--- /dev/null
+++ b/debian/patches/post-9beta2/0125-g726dec-set-channel-layout-at-initialization-instead.patch
@@ -0,0 +1,39 @@
+From e00eb03cd8bfb6993d33c30ccd560947b5f6bad5 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 13:26:14 -0400
+Subject: [PATCH 125/204] g726dec: set channel layout at initialization
+ instead of validating it
+
+---
+ libavcodec/g726.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libavcodec/g726.c b/libavcodec/g726.c
+index 7fa2be3..ed4bd26 100644
+--- a/libavcodec/g726.c
++++ b/libavcodec/g726.c
+@@ -22,6 +22,8 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+ #include <limits.h>
++
++#include "libavutil/audioconvert.h"
+ #include "libavutil/avassert.h"
+ #include "libavutil/opt.h"
+ #include "avcodec.h"
+@@ -428,10 +430,8 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
+ return AVERROR(EINVAL);
+ }
+
+- if(avctx->channels != 1){
+- av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
+- return AVERROR(EINVAL);
+- }
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
+
+ c->code_size = avctx->bits_per_coded_sample;
+ if (c->code_size < 2 || c->code_size > 5) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0126-g726dec-do-not-validate-sample-rate.patch b/debian/patches/post-9beta2/0126-g726dec-do-not-validate-sample-rate.patch
new file mode 100644
index 0000000..7bfb494
--- /dev/null
+++ b/debian/patches/post-9beta2/0126-g726dec-do-not-validate-sample-rate.patch
@@ -0,0 +1,32 @@
+From a346aaf148dc2ce53da30e2f67223834495c0fd6 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 13:26:46 -0400
+Subject: [PATCH 126/204] g726dec: do not validate sample rate
+
+For decoding it does not really matter what the sample rate is.
+---
+ libavcodec/g726.c | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/libavcodec/g726.c b/libavcodec/g726.c
+index ed4bd26..91b5e54 100644
+--- a/libavcodec/g726.c
++++ b/libavcodec/g726.c
+@@ -422,14 +422,6 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
+ {
+ G726Context* c = avctx->priv_data;
+
+- if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT &&
+- avctx->sample_rate != 8000) {
+- av_log(avctx, AV_LOG_ERROR, "Only 8kHz sample rate is allowed when "
+- "the compliance level is strict. Reduce the compliance level "
+- "if you wish to decode the stream anyway.\n");
+- return AVERROR(EINVAL);
+- }
+-
+ avctx->channels = 1;
+ avctx->channel_layout = AV_CH_LAYOUT_MONO;
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0127-libgsmdec-always-set-channel-layout-and-sample-rate-.patch b/debian/patches/post-9beta2/0127-libgsmdec-always-set-channel-layout-and-sample-rate-.patch
new file mode 100644
index 0000000..bfde73d
--- /dev/null
+++ b/debian/patches/post-9beta2/0127-libgsmdec-always-set-channel-layout-and-sample-rate-.patch
@@ -0,0 +1,50 @@
+From c5b8acad731c06389b98df8248b6a536e1b7e58d Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 15:43:59 -0400
+Subject: [PATCH 127/204] libgsmdec: always set channel layout and sample rate
+ at initialization
+
+Only mono 8kHz is supported.
+---
+ libavcodec/libgsm.c | 18 +++++-------------
+ 1 file changed, 5 insertions(+), 13 deletions(-)
+
+diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c
+index e6d435b..afed710 100644
+--- a/libavcodec/libgsm.c
++++ b/libavcodec/libgsm.c
+@@ -29,6 +29,7 @@
+
+ #include <gsm/gsm.h>
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "internal.h"
+ #include "gsm.h"
+@@ -149,19 +150,10 @@ typedef struct LibGSMDecodeContext {
+ static av_cold int libgsm_decode_init(AVCodecContext *avctx) {
+ LibGSMDecodeContext *s = avctx->priv_data;
+
+- if (avctx->channels > 1) {
+- av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
+- avctx->channels);
+- return -1;
+- }
+-
+- if (!avctx->channels)
+- avctx->channels = 1;
+-
+- if (!avctx->sample_rate)
+- avctx->sample_rate = 8000;
+-
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_rate = 8000;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ s->state = gsm_create();
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0128-gsmdec-always-set-channel-layout-and-sample-rate-at-.patch b/debian/patches/post-9beta2/0128-gsmdec-always-set-channel-layout-and-sample-rate-at-.patch
new file mode 100644
index 0000000..5338bae
--- /dev/null
+++ b/debian/patches/post-9beta2/0128-gsmdec-always-set-channel-layout-and-sample-rate-at-.patch
@@ -0,0 +1,41 @@
+From 32c7769e5c851ff7b47a83113b97a325dde7b442 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 15:45:38 -0400
+Subject: [PATCH 128/204] gsmdec: always set channel layout and sample rate at
+ initialization
+
+Only mono 8kHz is supported.
+---
+ libavcodec/gsmdec.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c
+index a5e0d7d..14b7e03 100644
+--- a/libavcodec/gsmdec.c
++++ b/libavcodec/gsmdec.c
+@@ -24,6 +24,7 @@
+ * GSM decoder
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "get_bits.h"
+ #include "msgsmdec.h"
+@@ -34,10 +35,10 @@ static av_cold int gsm_init(AVCodecContext *avctx)
+ {
+ GSMContext *s = avctx->priv_data;
+
+- avctx->channels = 1;
+- if (!avctx->sample_rate)
+- avctx->sample_rate = 8000;
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_rate = 8000;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ switch (avctx->codec_id) {
+ case AV_CODEC_ID_GSM:
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0129-imc-set-channels-to-1-instead-of-validating-it.patch b/debian/patches/post-9beta2/0129-imc-set-channels-to-1-instead-of-validating-it.patch
new file mode 100644
index 0000000..7daca20
--- /dev/null
+++ b/debian/patches/post-9beta2/0129-imc-set-channels-to-1-instead-of-validating-it.patch
@@ -0,0 +1,29 @@
+From 1c7a0161538a9e8417086759a5d6d3295337c433 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 15:54:29 -0400
+Subject: [PATCH 129/204] imc: set channels to 1 instead of validating it
+
+---
+ libavcodec/imc.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libavcodec/imc.c b/libavcodec/imc.c
+index 1156e8a..4c2d01d 100644
+--- a/libavcodec/imc.c
++++ b/libavcodec/imc.c
+@@ -175,8 +175,10 @@ static av_cold int imc_decode_init(AVCodecContext *avctx)
+ IMCContext *q = avctx->priv_data;
+ double r1, r2;
+
+- if ((avctx->codec_id == AV_CODEC_ID_IMC && avctx->channels != 1)
+- || (avctx->codec_id == AV_CODEC_ID_IAC && avctx->channels > 2)) {
++ if (avctx->codec_id == AV_CODEC_ID_IMC)
++ avctx->channels = 1;
++
++ if (avctx->channels > 2) {
+ av_log_ask_for_sample(avctx, "Number of channels is not supported\n");
+ return AVERROR_PATCHWELCOME;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0130-dpcm-use-AVCodecContext.channels-instead-of-keeping-.patch b/debian/patches/post-9beta2/0130-dpcm-use-AVCodecContext.channels-instead-of-keeping-.patch
new file mode 100644
index 0000000..01ac09d
--- /dev/null
+++ b/debian/patches/post-9beta2/0130-dpcm-use-AVCodecContext.channels-instead-of-keeping-.patch
@@ -0,0 +1,82 @@
+From 0fd1ddf15545a7bac1e8d2622d070fdf4bad95d8 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 16:03:20 -0400
+Subject: [PATCH 130/204] dpcm: use AVCodecContext.channels instead of keeping
+ a private copy
+
+---
+ libavcodec/dpcm.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
+index f9aff98..fb1c7ce 100644
+--- a/libavcodec/dpcm.c
++++ b/libavcodec/dpcm.c
+@@ -44,7 +44,6 @@
+
+ typedef struct DPCMContext {
+ AVFrame frame;
+- int channels;
+ int16_t roq_square_array[256];
+ int sample[2]; ///< previous sample (for SOL_DPCM)
+ const int8_t *sol_table; ///< delta table for SOL_DPCM
+@@ -123,7 +122,6 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx)
+ return AVERROR(EINVAL);
+ }
+
+- s->channels = avctx->channels;
+ s->sample[0] = s->sample[1] = 0;
+
+ switch(avctx->codec->id) {
+@@ -179,7 +177,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
+ int out = 0, ret;
+ int predictor[2];
+ int ch = 0;
+- int stereo = s->channels - 1;
++ int stereo = avctx->channels - 1;
+ int16_t *output_samples, *samples_end;
+ GetByteContext gb;
+
+@@ -193,10 +191,10 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
+ out = buf_size - 8;
+ break;
+ case AV_CODEC_ID_INTERPLAY_DPCM:
+- out = buf_size - 6 - s->channels;
++ out = buf_size - 6 - avctx->channels;
+ break;
+ case AV_CODEC_ID_XAN_DPCM:
+- out = buf_size - 2 * s->channels;
++ out = buf_size - 2 * avctx->channels;
+ break;
+ case AV_CODEC_ID_SOL_DPCM:
+ if (avctx->codec_tag != 3)
+@@ -211,7 +209,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
+ }
+
+ /* get output buffer */
+- s->frame.nb_samples = out / s->channels;
++ s->frame.nb_samples = out / avctx->channels;
+ if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return ret;
+@@ -245,7 +243,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
+ case AV_CODEC_ID_INTERPLAY_DPCM:
+ bytestream2_skipu(&gb, 6); /* skip over the stream mask and stream length */
+
+- for (ch = 0; ch < s->channels; ch++) {
++ for (ch = 0; ch < avctx->channels; ch++) {
+ predictor[ch] = sign_extend(bytestream2_get_le16u(&gb), 16);
+ *output_samples++ = predictor[ch];
+ }
+@@ -265,7 +263,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
+ {
+ int shift[2] = { 4, 4 };
+
+- for (ch = 0; ch < s->channels; ch++)
++ for (ch = 0; ch < avctx->channels; ch++)
+ predictor[ch] = sign_extend(bytestream2_get_le16u(&gb), 16);
+
+ ch = 0;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0131-libilbc-set-channel-layout.patch b/debian/patches/post-9beta2/0131-libilbc-set-channel-layout.patch
new file mode 100644
index 0000000..103edd7
--- /dev/null
+++ b/debian/patches/post-9beta2/0131-libilbc-set-channel-layout.patch
@@ -0,0 +1,38 @@
+From 30f8da29bf609d741bbebd33b2a5003c426ab919 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 17:41:47 -0400
+Subject: [PATCH 131/204] libilbc: set channel layout
+
+---
+ libavcodec/libilbc.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c
+index a93285c..2812061 100644
+--- a/libavcodec/libilbc.c
++++ b/libavcodec/libilbc.c
+@@ -21,6 +21,7 @@
+
+ #include <ilbc.h>
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "libavutil/common.h"
+ #include "libavutil/opt.h"
+@@ -68,9 +69,10 @@ static av_cold int ilbc_decode_init(AVCodecContext *avctx)
+ avcodec_get_frame_defaults(&s->frame);
+ avctx->coded_frame = &s->frame;
+
+- avctx->channels = 1;
+- avctx->sample_rate = 8000;
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_rate = 8000;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ return 0;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0132-libopencore-amr-set-channel-layout-for-amr-nb-or-if-.patch b/debian/patches/post-9beta2/0132-libopencore-amr-set-channel-layout-for-amr-nb-or-if-.patch
new file mode 100644
index 0000000..73a5016
--- /dev/null
+++ b/debian/patches/post-9beta2/0132-libopencore-amr-set-channel-layout-for-amr-nb-or-if-.patch
@@ -0,0 +1,47 @@
+From d40dab907aad684885988552a84da76488f298c0 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 17:49:59 -0400
+Subject: [PATCH 132/204] libopencore-amr: set channel layout for amr-nb or if
+ not set by the user
+
+---
+ libavcodec/libopencore-amr.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
+index 9a543b4..a754d52 100644
+--- a/libavcodec/libopencore-amr.c
++++ b/libavcodec/libopencore-amr.c
+@@ -19,6 +19,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "libavutil/avstring.h"
+ #include "libavutil/common.h"
+@@ -30,13 +31,16 @@ static void amr_decode_fix_avctx(AVCodecContext *avctx)
+ {
+ const int is_amr_wb = 1 + (avctx->codec_id == AV_CODEC_ID_AMR_WB);
+
+- if (!avctx->sample_rate)
+- avctx->sample_rate = 8000 * is_amr_wb;
++ avctx->sample_rate = 8000 * is_amr_wb;
+
+- if (!avctx->channels)
+- avctx->channels = 1;
++ if (avctx->channels > 1) {
++ av_log_missing_feature(avctx, "multi-channel AMR", 0);
++ return AVERROR_PATCHWELCOME;
++ }
+
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ }
+
+ #if CONFIG_LIBOPENCORE_AMRNB
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0133-nellymoserdec-set-channels-to-1.patch b/debian/patches/post-9beta2/0133-nellymoserdec-set-channels-to-1.patch
new file mode 100644
index 0000000..0b8c9cb
--- /dev/null
+++ b/debian/patches/post-9beta2/0133-nellymoserdec-set-channels-to-1.patch
@@ -0,0 +1,24 @@
+From d26701ce2f3504e2ee341251448db3af6328a69b Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 17:58:24 -0400
+Subject: [PATCH 133/204] nellymoserdec: set channels to 1
+
+---
+ libavcodec/nellymoserdec.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
+index fce184a..f17e9fd 100644
+--- a/libavcodec/nellymoserdec.c
++++ b/libavcodec/nellymoserdec.c
+@@ -129,6 +129,7 @@ static av_cold int decode_init(AVCodecContext * avctx) {
+ if (!ff_sine_128[127])
+ ff_init_ff_sine_windows(7);
+
++ avctx->channels = 1;
+ avctx->channel_layout = AV_CH_LAYOUT_MONO;
+
+ avcodec_get_frame_defaults(&s->frame);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0134-qcelpdec-set-channel-layout.patch b/debian/patches/post-9beta2/0134-qcelpdec-set-channel-layout.patch
new file mode 100644
index 0000000..9a00d77
--- /dev/null
+++ b/debian/patches/post-9beta2/0134-qcelpdec-set-channel-layout.patch
@@ -0,0 +1,35 @@
+From e3d6ab57042ef7b35f24bf154fba39369034a665 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 18:25:46 -0400
+Subject: [PATCH 134/204] qcelpdec: set channel layout
+
+---
+ libavcodec/qcelpdec.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c
+index edb1d24..9c2b354 100644
+--- a/libavcodec/qcelpdec.c
++++ b/libavcodec/qcelpdec.c
+@@ -29,6 +29,7 @@
+
+ #include <stddef.h>
+
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "internal.h"
+ #include "get_bits.h"
+@@ -89,7 +90,9 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx)
+ QCELPContext *q = avctx->priv_data;
+ int i;
+
+- avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+
+ for (i = 0; i < 10; i++)
+ q->prev_lspf[i] = (i + 1) / 11.;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0135-qdm2-make-sure-channels-is-not-0-and-set-channel-lay.patch b/debian/patches/post-9beta2/0135-qdm2-make-sure-channels-is-not-0-and-set-channel-lay.patch
new file mode 100644
index 0000000..2b1d65b
--- /dev/null
+++ b/debian/patches/post-9beta2/0135-qdm2-make-sure-channels-is-not-0-and-set-channel-lay.patch
@@ -0,0 +1,37 @@
+From be2ab8b75a634a686a5ced1544c0c9a4ebeab0dc Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 18:53:19 -0400
+Subject: [PATCH 135/204] qdm2: make sure channels is not <= 0 and set channel
+ layout
+
+---
+ libavcodec/qdm2.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
+index 4d3b391..8e93886 100644
+--- a/libavcodec/qdm2.c
++++ b/libavcodec/qdm2.c
+@@ -36,6 +36,7 @@
+ #include <stdio.h>
+
+ #define BITSTREAM_READER_LE
++#include "libavutil/audioconvert.h"
+ #include "avcodec.h"
+ #include "get_bits.h"
+ #include "dsputil.h"
+@@ -1768,8 +1769,10 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
+
+ avctx->channels = s->nb_channels = s->channels = AV_RB32(extradata);
+ extradata += 4;
+- if (s->channels > MPA_MAX_CHANNELS)
++ if (s->channels <= 0 || s->channels > MPA_MAX_CHANNELS)
+ return AVERROR_INVALIDDATA;
++ avctx->channel_layout = avctx->channels == 2 ? AV_CH_LAYOUT_STEREO :
++ AV_CH_LAYOUT_MONO;
+
+ avctx->sample_rate = AV_RB32(extradata);
+ extradata += 4;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0136-qdm2-remove-unneeded-checks-for-channel-count.patch b/debian/patches/post-9beta2/0136-qdm2-remove-unneeded-checks-for-channel-count.patch
new file mode 100644
index 0000000..820873d
--- /dev/null
+++ b/debian/patches/post-9beta2/0136-qdm2-remove-unneeded-checks-for-channel-count.patch
@@ -0,0 +1,38 @@
+From eb38d8fe926bdce8110fa4be4fddf6598a079a20 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 18:54:29 -0400
+Subject: [PATCH 136/204] qdm2: remove unneeded checks for channel count
+
+---
+ libavcodec/qdm2.c | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
+index 8e93886..a094e6c 100644
+--- a/libavcodec/qdm2.c
++++ b/libavcodec/qdm2.c
+@@ -544,10 +544,6 @@ static void fill_tone_level_array (QDM2Context *q, int flag)
+ int i, sb, ch, sb_used;
+ int tmp, tab;
+
+- // This should never happen
+- if (q->nb_channels <= 0)
+- return;
+-
+ for (ch = 0; ch < q->nb_channels; ch++)
+ for (sb = 0; sb < 30; sb++)
+ for (i = 0; i < 8; i++) {
+@@ -643,10 +639,6 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra
+ int add1, add2, add3, add4;
+ int64_t multres;
+
+- // This should never happen
+- if (nb_channels <= 0)
+- return;
+-
+ if (!superblocktype_2_3) {
+ /* This case is untested, no samples available */
+ SAMPLES_NEEDED
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0137-ra144dec-set-channel-layout.patch b/debian/patches/post-9beta2/0137-ra144dec-set-channel-layout.patch
new file mode 100644
index 0000000..c867729
--- /dev/null
+++ b/debian/patches/post-9beta2/0137-ra144dec-set-channel-layout.patch
@@ -0,0 +1,35 @@
+From 6159f6436495ed8859fe9d32c4c2c1a2eb4c1e91 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 22 Oct 2012 18:57:39 -0400
+Subject: [PATCH 137/204] ra144dec: set channel layout
+
+---
+ libavcodec/ra144dec.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c
+index 0cb4f86..cee3892 100644
+--- a/libavcodec/ra144dec.c
++++ b/libavcodec/ra144dec.c
+@@ -22,6 +22,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/intmath.h"
+ #include "avcodec.h"
+ #include "get_bits.h"
+@@ -37,7 +38,9 @@ static av_cold int ra144_decode_init(AVCodecContext * avctx)
+ ractx->lpc_coef[0] = ractx->lpc_tables[0];
+ ractx->lpc_coef[1] = ractx->lpc_tables[1];
+
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ avcodec_get_frame_defaults(&ractx->frame);
+ avctx->coded_frame = &ractx->frame;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0138-ra288dec-set-channel-layout.patch b/debian/patches/post-9beta2/0138-ra288dec-set-channel-layout.patch
new file mode 100644
index 0000000..3cccb6f
--- /dev/null
+++ b/debian/patches/post-9beta2/0138-ra288dec-set-channel-layout.patch
@@ -0,0 +1,37 @@
+From 4e13e50432bd1c1a89f626f8196b55a0302c8f19 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 00:35:50 -0400
+Subject: [PATCH 138/204] ra288dec: set channel layout
+
+---
+ libavcodec/ra288.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
+index 1d02c7b..e080d2b 100644
+--- a/libavcodec/ra288.c
++++ b/libavcodec/ra288.c
+@@ -19,6 +19,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/float_dsp.h"
+ #include "avcodec.h"
+ #define BITSTREAM_READER_LE
+@@ -61,7 +62,11 @@ typedef struct {
+ static av_cold int ra288_decode_init(AVCodecContext *avctx)
+ {
+ RA288Context *ractx = avctx->priv_data;
+- avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
++
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
++
+ avpriv_float_dsp_init(&ractx->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
+
+ avcodec_get_frame_defaults(&ractx->frame);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0139-shorten-validate-that-the-channel-count-in-the-heade.patch b/debian/patches/post-9beta2/0139-shorten-validate-that-the-channel-count-in-the-heade.patch
new file mode 100644
index 0000000..8bcb58f
--- /dev/null
+++ b/debian/patches/post-9beta2/0139-shorten-validate-that-the-channel-count-in-the-heade.patch
@@ -0,0 +1,26 @@
+From 4c53f4aed3edfa58360c7a2a468782eae31d3176 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 00:40:51 -0400
+Subject: [PATCH 139/204] shorten: validate that the channel count in the
+ header is not <= 0
+
+---
+ libavcodec/shorten.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
+index 1664a90..be2b8e2 100644
+--- a/libavcodec/shorten.c
++++ b/libavcodec/shorten.c
+@@ -342,7 +342,7 @@ static int read_header(ShortenContext *s)
+ s->internal_ftype = get_uint(s, TYPESIZE);
+
+ s->channels = get_uint(s, CHANSIZE);
+- if (s->channels > MAX_CHANNELS) {
++ if (s->channels <= 0 || s->channels > MAX_CHANNELS) {
+ av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
+ return -1;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0140-sipr-set-channel-layout.patch b/debian/patches/post-9beta2/0140-sipr-set-channel-layout.patch
new file mode 100644
index 0000000..9db99a2
--- /dev/null
+++ b/debian/patches/post-9beta2/0140-sipr-set-channel-layout.patch
@@ -0,0 +1,35 @@
+From 523734eb6a904c43cf73d801f1c885829380f0de Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 00:51:26 -0400
+Subject: [PATCH 140/204] sipr: set channel layout
+
+---
+ libavcodec/sipr.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c
+index 1e9168a..9db0923 100644
+--- a/libavcodec/sipr.c
++++ b/libavcodec/sipr.c
+@@ -25,6 +25,7 @@
+ #include <stdint.h>
+ #include <string.h>
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/mathematics.h"
+ #include "avcodec.h"
+ #define BITSTREAM_READER_LE
+@@ -509,7 +510,9 @@ static av_cold int sipr_decoder_init(AVCodecContext * avctx)
+ for (i = 0; i < 4; i++)
+ ctx->energy_history[i] = -14;
+
+- avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+
+ avcodec_get_frame_defaults(&ctx->frame);
+ avctx->coded_frame = &ctx->frame;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0141-truespeech-set-channel-layout.patch b/debian/patches/post-9beta2/0141-truespeech-set-channel-layout.patch
new file mode 100644
index 0000000..cb39317
--- /dev/null
+++ b/debian/patches/post-9beta2/0141-truespeech-set-channel-layout.patch
@@ -0,0 +1,34 @@
+From cebea00c8abac0817d3ae8bdd9573a603c655b75 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 00:53:16 -0400
+Subject: [PATCH 141/204] truespeech: set channel layout
+
+---
+ libavcodec/truespeech.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
+index bbee146..efe5f45 100644
+--- a/libavcodec/truespeech.c
++++ b/libavcodec/truespeech.c
+@@ -19,6 +19,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/intreadwrite.h"
+ #include "avcodec.h"
+ #include "dsputil.h"
+@@ -66,7 +67,8 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
+ return AVERROR(EINVAL);
+ }
+
+- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ ff_dsputil_init(&c->dsp, avctx);
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0142-twinvq-validate-that-channels-is-not-0.patch b/debian/patches/post-9beta2/0142-twinvq-validate-that-channels-is-not-0.patch
new file mode 100644
index 0000000..f05c74f
--- /dev/null
+++ b/debian/patches/post-9beta2/0142-twinvq-validate-that-channels-is-not-0.patch
@@ -0,0 +1,27 @@
+From 8cc72ce5a0d8ab6bc88d28cf55cd62674240121d Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 13:15:24 -0400
+Subject: [PATCH 142/204] twinvq: validate that channels is not <= 0
+
+This could occur due to integer overflow when reading the channel count from
+the extradata.
+---
+ libavcodec/twinvq.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
+index d009196..50ee626 100644
+--- a/libavcodec/twinvq.c
++++ b/libavcodec/twinvq.c
+@@ -1126,7 +1126,7 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
+ default: avctx->sample_rate = isampf * 1000; break;
+ }
+
+- if (avctx->channels > CHANNELS_MAX) {
++ if (avctx->channels <= 0 || avctx->channels > CHANNELS_MAX) {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n",
+ avctx->channels);
+ return -1;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0143-twinvq-set-channel-layout.patch b/debian/patches/post-9beta2/0143-twinvq-set-channel-layout.patch
new file mode 100644
index 0000000..16770ac
--- /dev/null
+++ b/debian/patches/post-9beta2/0143-twinvq-set-channel-layout.patch
@@ -0,0 +1,34 @@
+From 335826cf5f7169199ed0a8d3a61f697ec0438d30 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 13:17:17 -0400
+Subject: [PATCH 143/204] twinvq: set channel layout
+
+---
+ libavcodec/twinvq.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
+index 50ee626..3159e49 100644
+--- a/libavcodec/twinvq.c
++++ b/libavcodec/twinvq.c
+@@ -19,6 +19,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/float_dsp.h"
+ #include "avcodec.h"
+ #include "get_bits.h"
+@@ -1131,6 +1132,9 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
+ avctx->channels);
+ return -1;
+ }
++ avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO :
++ AV_CH_LAYOUT_STEREO;
++
+ ibps = avctx->bit_rate / (1000 * avctx->channels);
+
+ switch ((isampf << 8) + ibps) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0144-twinvq-validate-sample-rate-code.patch b/debian/patches/post-9beta2/0144-twinvq-validate-sample-rate-code.patch
new file mode 100644
index 0000000..5333406
--- /dev/null
+++ b/debian/patches/post-9beta2/0144-twinvq-validate-sample-rate-code.patch
@@ -0,0 +1,30 @@
+From b5f628e227743fc1725a28b5b21f538a40efca82 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 13:17:50 -0400
+Subject: [PATCH 144/204] twinvq: validate sample rate code
+
+A large invalid value could cause undefined behavior when left-shifted
+by 8 later in the function.
+---
+ libavcodec/twinvq.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
+index 3159e49..7af370e 100644
+--- a/libavcodec/twinvq.c
++++ b/libavcodec/twinvq.c
+@@ -1120,6 +1120,11 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
+ avctx->channels = AV_RB32(avctx->extradata ) + 1;
+ avctx->bit_rate = AV_RB32(avctx->extradata + 4) * 1000;
+ isampf = AV_RB32(avctx->extradata + 8);
++
++ if (isampf < 8 || isampf > 44) {
++ av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate\n");
++ return AVERROR_INVALIDDATA;
++ }
+ switch (isampf) {
+ case 44: avctx->sample_rate = 44100; break;
+ case 22: avctx->sample_rate = 22050; break;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0145-vmdaudio-set-channel-layout.patch b/debian/patches/post-9beta2/0145-vmdaudio-set-channel-layout.patch
new file mode 100644
index 0000000..412c16e
--- /dev/null
+++ b/debian/patches/post-9beta2/0145-vmdaudio-set-channel-layout.patch
@@ -0,0 +1,34 @@
+From 50a65e7a540ce6747f81d6dbf6a602ad35be77ff Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 15:27:44 -0400
+Subject: [PATCH 145/204] vmdaudio: set channel layout
+
+---
+ libavcodec/vmdav.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
+index 5776d92..6efc9e7 100644
+--- a/libavcodec/vmdav.c
++++ b/libavcodec/vmdav.c
+@@ -43,6 +43,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/common.h"
+ #include "libavutil/intreadwrite.h"
+ #include "avcodec.h"
+@@ -508,6 +509,9 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
+ return AVERROR(EINVAL);
+ }
+
++ avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO :
++ AV_CH_LAYOUT_STEREO;
++
+ if (avctx->bits_per_coded_sample == 16)
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ else
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0146-wma-do-not-keep-private-copies-of-some-AVCodecContex.patch b/debian/patches/post-9beta2/0146-wma-do-not-keep-private-copies-of-some-AVCodecContex.patch
new file mode 100644
index 0000000..9c34e22
--- /dev/null
+++ b/debian/patches/post-9beta2/0146-wma-do-not-keep-private-copies-of-some-AVCodecContex.patch
@@ -0,0 +1,419 @@
+From 2ed40608e9499de7ed6bd4bd61cc50645ec6d8a4 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 16:30:59 -0400
+Subject: [PATCH 146/204] wma: do not keep private copies of some
+ AVCodecContext fields
+
+channels, sample_rate, bit_rate, and block_align can be used directly from
+the AVCodecContext
+---
+ libavcodec/wma.c | 36 ++++++++++++++++--------------------
+ libavcodec/wma.h | 4 ----
+ libavcodec/wmadec.c | 34 +++++++++++++++++-----------------
+ libavcodec/wmaenc.c | 30 +++++++++++++++---------------
+ 4 files changed, 48 insertions(+), 56 deletions(-)
+
+diff --git a/libavcodec/wma.c b/libavcodec/wma.c
+index f9ba9c3..9808a16 100644
+--- a/libavcodec/wma.c
++++ b/libavcodec/wma.c
+@@ -82,11 +82,6 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ || avctx->bit_rate <= 0)
+ return -1;
+
+- s->sample_rate = avctx->sample_rate;
+- s->nb_channels = avctx->channels;
+- s->bit_rate = avctx->bit_rate;
+- s->block_align = avctx->block_align;
+-
+ ff_dsputil_init(&s->dsp, avctx);
+ ff_fmt_convert_init(&s->fmt_conv, avctx);
+ avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
+@@ -98,7 +93,8 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ }
+
+ /* compute MDCT block size */
+- s->frame_len_bits = ff_wma_get_frame_len_bits(s->sample_rate, s->version, 0);
++ s->frame_len_bits = ff_wma_get_frame_len_bits(avctx->sample_rate,
++ s->version, 0);
+ s->next_block_len_bits = s->frame_len_bits;
+ s->prev_block_len_bits = s->frame_len_bits;
+ s->block_len_bits = s->frame_len_bits;
+@@ -107,7 +103,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ if (s->use_variable_block_len) {
+ int nb_max, nb;
+ nb = ((flags2 >> 3) & 3) + 1;
+- if ((s->bit_rate / s->nb_channels) >= 32000)
++ if ((avctx->bit_rate / avctx->channels) >= 32000)
+ nb += 2;
+ nb_max = s->frame_len_bits - BLOCK_MIN_BITS;
+ if (nb > nb_max)
+@@ -119,10 +115,10 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+
+ /* init rate dependent parameters */
+ s->use_noise_coding = 1;
+- high_freq = s->sample_rate * 0.5;
++ high_freq = avctx->sample_rate * 0.5;
+
+ /* if version 2, then the rates are normalized */
+- sample_rate1 = s->sample_rate;
++ sample_rate1 = avctx->sample_rate;
+ if (s->version == 2) {
+ if (sample_rate1 >= 44100) {
+ sample_rate1 = 44100;
+@@ -137,13 +133,13 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ }
+ }
+
+- bps = (float)s->bit_rate / (float)(s->nb_channels * s->sample_rate);
++ bps = (float)avctx->bit_rate / (float)(avctx->channels * avctx->sample_rate);
+ s->byte_offset_bits = av_log2((int)(bps * s->frame_len / 8.0 + 0.5)) + 2;
+
+ /* compute high frequency value and choose if noise coding should
+ be activated */
+ bps1 = bps;
+- if (s->nb_channels == 2)
++ if (avctx->channels == 2)
+ bps1 = bps * 1.6;
+ if (sample_rate1 == 44100) {
+ if (bps1 >= 0.61) {
+@@ -186,8 +182,8 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ }
+ av_dlog(s->avctx, "flags2=0x%x\n", flags2);
+ av_dlog(s->avctx, "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->block_align);
++ s->version, avctx->channels, avctx->sample_rate, avctx->bit_rate,
++ avctx->block_align);
+ av_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
+ bps, bps1, high_freq, s->byte_offset_bits);
+ av_dlog(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
+@@ -210,7 +206,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ lpos = 0;
+ for (i = 0; i < 25; i++) {
+ a = ff_wma_critical_freqs[i];
+- b = s->sample_rate;
++ b = avctx->sample_rate;
+ pos = ((block_len * 2 * a) + (b >> 1)) / b;
+ if (pos > block_len)
+ pos = block_len;
+@@ -227,11 +223,11 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ table = NULL;
+ a = s->frame_len_bits - BLOCK_MIN_BITS - k;
+ if (a < 3) {
+- if (s->sample_rate >= 44100) {
++ if (avctx->sample_rate >= 44100) {
+ table = exponent_band_44100[a];
+- } else if (s->sample_rate >= 32000) {
++ } else if (avctx->sample_rate >= 32000) {
+ table = exponent_band_32000[a];
+- } else if (s->sample_rate >= 22050) {
++ } else if (avctx->sample_rate >= 22050) {
+ table = exponent_band_22050[a];
+ }
+ }
+@@ -245,7 +241,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ lpos = 0;
+ for (i = 0; i < 25; i++) {
+ a = ff_wma_critical_freqs[i];
+- b = s->sample_rate;
++ b = avctx->sample_rate;
+ pos = ((block_len * 2 * a) + (b << 1)) / (4 * b);
+ pos <<= 2;
+ if (pos > block_len)
+@@ -264,7 +260,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+ 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->sample_rate + 0.5);
++ avctx->sample_rate + 0.5);
+ n = s->exponent_sizes[k];
+ j = 0;
+ pos = 0;
+@@ -344,7 +340,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
+
+ /* choose the VLC tables for the coefficients */
+ coef_vlc_table = 2;
+- if (s->sample_rate >= 32000) {
++ if (avctx->sample_rate >= 32000) {
+ if (bps1 < 0.72) {
+ coef_vlc_table = 0;
+ } else if (bps1 < 1.16) {
+diff --git a/libavcodec/wma.h b/libavcodec/wma.h
+index f81e095..fb2aa8b 100644
+--- a/libavcodec/wma.h
++++ b/libavcodec/wma.h
+@@ -69,11 +69,7 @@ typedef struct WMACodecContext {
+ AVFrame frame;
+ GetBitContext gb;
+ PutBitContext pb;
+- int sample_rate;
+- int nb_channels;
+- int bit_rate;
+ int version; ///< 1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2)
+- int block_align;
+ int use_bit_reservoir;
+ int use_variable_block_len;
+ int use_exp_vlc; ///< exponent coding: 0 = lsp, 1 = vlc + delta
+diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
+index bbb8402..eb7fe7c 100644
+--- a/libavcodec/wmadec.c
++++ b/libavcodec/wmadec.c
+@@ -475,11 +475,11 @@ static int wma_decode_block(WMACodecContext *s)
+ return -1;
+ }
+
+- if (s->nb_channels == 2) {
++ if (s->avctx->channels == 2) {
+ s->ms_stereo = get_bits1(&s->gb);
+ }
+ v = 0;
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for(ch = 0; ch < s->avctx->channels; ch++) {
+ a = get_bits1(&s->gb);
+ s->channel_coded[ch] = a;
+ v |= a;
+@@ -506,13 +506,13 @@ static int wma_decode_block(WMACodecContext *s)
+
+ /* compute number of coefficients */
+ n = s->coefs_end[bsize] - s->coefs_start;
+- for(ch = 0; ch < s->nb_channels; ch++)
++ for(ch = 0; ch < s->avctx->channels; ch++)
+ nb_coefs[ch] = n;
+
+ /* complex coding */
+ if (s->use_noise_coding) {
+
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for(ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ int i, n, a;
+ n = s->exponent_high_sizes[bsize];
+@@ -525,7 +525,7 @@ static int wma_decode_block(WMACodecContext *s)
+ }
+ }
+ }
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for(ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ int i, n, val, code;
+
+@@ -553,7 +553,7 @@ static int wma_decode_block(WMACodecContext *s)
+ /* exponents can be reused in short blocks. */
+ if ((s->block_len_bits == s->frame_len_bits) ||
+ get_bits1(&s->gb)) {
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for(ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ if (s->use_exp_vlc) {
+ if (decode_exp_vlc(s, ch) < 0)
+@@ -567,7 +567,7 @@ static int wma_decode_block(WMACodecContext *s)
+ }
+
+ /* parse spectral coefficients : just RLE encoding */
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ int tindex;
+ WMACoef* ptr = &s->coefs1[ch][0];
+@@ -581,7 +581,7 @@ static int wma_decode_block(WMACodecContext *s)
+ 0, ptr, 0, nb_coefs[ch],
+ s->block_len, s->frame_len_bits, coef_nb_bits);
+ }
+- if (s->version == 1 && s->nb_channels >= 2) {
++ if (s->version == 1 && s->avctx->channels >= 2) {
+ align_get_bits(&s->gb);
+ }
+ }
+@@ -596,7 +596,7 @@ static int wma_decode_block(WMACodecContext *s)
+ }
+
+ /* finally compute the MDCT coefficients */
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ WMACoef *coefs1;
+ float *coefs, *exponents, mult, mult1, noise;
+@@ -700,7 +700,7 @@ static int wma_decode_block(WMACodecContext *s)
+ }
+
+ #ifdef TRACE
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ dump_floats(s, "exponents", 3, s->exponents[ch], s->block_len);
+ dump_floats(s, "coefs", 1, s->coefs[ch], s->block_len);
+@@ -724,7 +724,7 @@ static int wma_decode_block(WMACodecContext *s)
+ next:
+ mdct = &s->mdct_ctx[bsize];
+
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ int n4, index;
+
+ n4 = s->block_len / 2;
+@@ -768,7 +768,7 @@ static int wma_decode_frame(WMACodecContext *s, float **samples,
+ break;
+ }
+
+- for (ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ /* copy current block to output */
+ memcpy(samples[ch] + samples_offset, s->frame_out[ch],
+ s->frame_len * sizeof(*s->frame_out[ch]));
+@@ -801,13 +801,13 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
+ s->last_superframe_len = 0;
+ return 0;
+ }
+- if (buf_size < s->block_align) {
++ if (buf_size < avctx->block_align) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Input packet size too small (%d < %d)\n",
+- buf_size, s->block_align);
++ buf_size, avctx->block_align);
+ return AVERROR_INVALIDDATA;
+ }
+- buf_size = s->block_align;
++ buf_size = avctx->block_align;
+
+ init_get_bits(&s->gb, buf, buf_size*8);
+
+@@ -902,12 +902,12 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
+
+ av_dlog(s->avctx, "%d %d %d %d outbytes:%td eaten:%d\n",
+ s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len,
+- (int8_t *)samples - (int8_t *)data, s->block_align);
++ (int8_t *)samples - (int8_t *)data, avctx->block_align);
+
+ *got_frame_ptr = 1;
+ *(AVFrame *)data = s->frame;
+
+- return s->block_align;
++ return avctx->block_align;
+ fail:
+ /* when error, we reset the bit reservoir */
+ s->last_superframe_len = 0;
+diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
+index 8abb55b..13d8a1c 100644
+--- a/libavcodec/wmaenc.c
++++ b/libavcodec/wmaenc.c
+@@ -29,7 +29,7 @@
+
+ static int encode_init(AVCodecContext * avctx){
+ WMACodecContext *s = avctx->priv_data;
+- int i, flags1, flags2;
++ int i, flags1, flags2, block_align;
+ uint8_t *extradata;
+
+ s->avctx = avctx;
+@@ -80,10 +80,10 @@ static int encode_init(AVCodecContext * avctx){
+ for(i = 0; i < s->nb_block_sizes; i++)
+ ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0, 1.0);
+
+- s->block_align = avctx->bit_rate * (int64_t)s->frame_len /
++ block_align = avctx->bit_rate * (int64_t)s->frame_len /
+ (avctx->sample_rate * 8);
+- s->block_align = FFMIN(s->block_align, MAX_CODED_SUPERFRAME_SIZE);
+- avctx->block_align = s->block_align;
++ block_align = FFMIN(block_align, MAX_CODED_SUPERFRAME_SIZE);
++ avctx->block_align = block_align;
+ avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate /
+ s->frame_len;
+ avctx->frame_size = avctx->delay = s->frame_len;
+@@ -188,7 +188,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
+
+ //FIXME factor
+ v = s->coefs_end[bsize] - s->coefs_start;
+- for(ch = 0; ch < s->nb_channels; ch++)
++ for (ch = 0; ch < s->avctx->channels; ch++)
+ nb_coefs[ch] = v;
+ {
+ int n4 = s->block_len / 2;
+@@ -198,18 +198,18 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
+ }
+ }
+
+- if (s->nb_channels == 2) {
++ if (s->avctx->channels == 2) {
+ put_bits(&s->pb, 1, !!s->ms_stereo);
+ }
+
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ s->channel_coded[ch] = 1; //FIXME only set channel_coded when needed, instead of always
+ if (s->channel_coded[ch]) {
+ init_exp(s, ch, fixed_exp);
+ }
+ }
+
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ WMACoef *coefs1;
+ float *coefs, *exponents, mult;
+@@ -237,7 +237,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
+ }
+
+ v = 0;
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ int a = s->channel_coded[ch];
+ put_bits(&s->pb, 1, a);
+ v |= a;
+@@ -253,7 +253,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
+ coef_nb_bits= ff_wma_total_gain_to_bits(total_gain);
+
+ if (s->use_noise_coding) {
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ int i, n;
+ n = s->exponent_high_sizes[bsize];
+@@ -272,7 +272,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
+ }
+
+ if (parse_exponents) {
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ if (s->use_exp_vlc) {
+ encode_exp_vlc(s, ch, fixed_exp);
+@@ -286,7 +286,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
+ assert(0); //FIXME not implemented
+ }
+
+- for(ch = 0; ch < s->nb_channels; ch++) {
++ for (ch = 0; ch < s->avctx->channels; ch++) {
+ if (s->channel_coded[ch]) {
+ int run, tindex;
+ WMACoef *ptr, *eptr;
+@@ -324,7 +324,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
+ if(run)
+ put_bits(&s->pb, s->coef_vlcs[tindex]->huffbits[1], s->coef_vlcs[tindex]->huffcodes[1]);
+ }
+- if (s->version == 1 && s->nb_channels >= 2) {
++ if (s->version == 1 && s->avctx->channels >= 2) {
+ avpriv_align_put_bits(&s->pb);
+ }
+ }
+@@ -343,7 +343,7 @@ static int encode_frame(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
+
+ avpriv_align_put_bits(&s->pb);
+
+- return put_bits_count(&s->pb)/8 - s->block_align;
++ return put_bits_count(&s->pb) / 8 - s->avctx->block_align;
+ }
+
+ static int encode_superframe(AVCodecContext *avctx, AVPacket *avpkt,
+@@ -413,7 +413,7 @@ static int encode_superframe(AVCodecContext *avctx, AVPacket *avpkt,
+ if (frame->pts != AV_NOPTS_VALUE)
+ avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
+
+- avpkt->size = s->block_align;
++ avpkt->size = avctx->block_align;
+ *got_packet_ptr = 1;
+ return 0;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0147-wmapro-use-AVCodecContext.channels-instead-of-keepin.patch b/debian/patches/post-9beta2/0147-wmapro-use-AVCodecContext.channels-instead-of-keepin.patch
new file mode 100644
index 0000000..4cb0be7
--- /dev/null
+++ b/debian/patches/post-9beta2/0147-wmapro-use-AVCodecContext.channels-instead-of-keepin.patch
@@ -0,0 +1,212 @@
+From 002097a00bb93718c171c0c0abcc122475dac838 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 17:10:37 -0400
+Subject: [PATCH 147/204] wmapro: use AVCodecContext.channels instead of
+ keeping a private copy
+
+---
+ libavcodec/wmaprodec.c | 52 +++++++++++++++++++++++-------------------------
+ 1 file changed, 25 insertions(+), 27 deletions(-)
+
+diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
+index d172895..43fdbc0 100644
+--- a/libavcodec/wmaprodec.c
++++ b/libavcodec/wmaprodec.c
+@@ -184,7 +184,6 @@ typedef struct WMAProDecodeCtx {
+ uint8_t bits_per_sample; ///< integer audio sample size for the unscaled IMDCT output (used to scale to [-1.0, 1.0])
+ uint16_t samples_per_frame; ///< number of samples to output
+ uint16_t log2_frame_size;
+- int8_t num_channels; ///< number of channels in the stream (same as AVCodecContext.num_channels)
+ int8_t lfe_channel; ///< lfe channel index
+ uint8_t max_num_subframes;
+ uint8_t subframe_len_bits; ///< number of bits used for the subframe length
+@@ -246,7 +245,7 @@ static av_cold void dump_context(WMAProDecodeCtx *s)
+ PRINT("log2 frame size", s->log2_frame_size);
+ PRINT("max num subframes", s->max_num_subframes);
+ PRINT("len prefix", s->len_prefix);
+- PRINT("num channels", s->num_channels);
++ PRINT("num channels", s->avctx->channels);
+ }
+
+ /**
+@@ -337,18 +336,17 @@ static av_cold int decode_init(AVCodecContext *avctx)
+ return AVERROR_INVALIDDATA;
+ }
+
+- s->num_channels = avctx->channels;
+-
+- if (s->num_channels < 0) {
+- av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n", s->num_channels);
++ if (avctx->channels < 0) {
++ av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n",
++ avctx->channels);
+ return AVERROR_INVALIDDATA;
+- } else if (s->num_channels > WMAPRO_MAX_CHANNELS) {
++ } else if (avctx->channels > WMAPRO_MAX_CHANNELS) {
+ av_log_ask_for_sample(avctx, "unsupported number of channels\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
+ /** init previous block len */
+- for (i = 0; i < s->num_channels; i++)
++ for (i = 0; i < avctx->channels; i++)
+ s->channel[i].prev_block_len = s->samples_per_frame;
+
+ /** extract lfe channel position */
+@@ -525,7 +523,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
+ {
+ uint16_t num_samples[WMAPRO_MAX_CHANNELS] = { 0 };/**< sum of samples for all currently known subframes of a channel */
+ uint8_t contains_subframe[WMAPRO_MAX_CHANNELS]; /**< flag indicating if a channel contains the current subframe */
+- int channels_for_cur_subframe = s->num_channels; /**< number of channels that contain the current subframe */
++ int channels_for_cur_subframe = s->avctx->channels; /**< number of channels that contain the current subframe */
+ int fixed_channel_layout = 0; /**< flag indicating that all channels use the same subframe offsets and sizes */
+ int min_channel_len = 0; /**< smallest sum of samples (channels with this length will be processed first) */
+ int c;
+@@ -537,7 +535,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
+ */
+
+ /** reset tiling information */
+- for (c = 0; c < s->num_channels; c++)
++ for (c = 0; c < s->avctx->channels; c++)
+ s->channel[c].num_subframes = 0;
+
+ if (s->max_num_subframes == 1 || get_bits1(&s->gb))
+@@ -548,7 +546,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
+ int subframe_len;
+
+ /** check which channels contain the subframe */
+- for (c = 0; c < s->num_channels; c++) {
++ for (c = 0; c < s->avctx->channels; c++) {
+ if (num_samples[c] == min_channel_len) {
+ if (fixed_channel_layout || channels_for_cur_subframe == 1 ||
+ (min_channel_len == s->samples_per_frame - s->min_samples_per_subframe))
+@@ -565,7 +563,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
+
+ /** add subframes to the individual channels and find new min_channel_len */
+ min_channel_len += subframe_len;
+- for (c = 0; c < s->num_channels; c++) {
++ for (c = 0; c < s->avctx->channels; c++) {
+ WMAProChannelCtx* chan = &s->channel[c];
+
+ if (contains_subframe[c]) {
+@@ -592,7 +590,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
+ }
+ } while (min_channel_len < s->samples_per_frame);
+
+- for (c = 0; c < s->num_channels; c++) {
++ for (c = 0; c < s->avctx->channels; c++) {
+ int i;
+ int offset = 0;
+ for (i = 0; i < s->channel[c].num_subframes; i++) {
+@@ -618,8 +616,8 @@ static void decode_decorrelation_matrix(WMAProDecodeCtx *s,
+ int i;
+ int offset = 0;
+ int8_t rotation_offset[WMAPRO_MAX_CHANNELS * WMAPRO_MAX_CHANNELS];
+- memset(chgroup->decorrelation_matrix, 0, s->num_channels *
+- s->num_channels * sizeof(*chgroup->decorrelation_matrix));
++ memset(chgroup->decorrelation_matrix, 0, s->avctx->channels *
++ s->avctx->channels * sizeof(*chgroup->decorrelation_matrix));
+
+ for (i = 0; i < chgroup->num_channels * (chgroup->num_channels - 1) >> 1; i++)
+ rotation_offset[i] = get_bits(&s->gb, 6);
+@@ -672,7 +670,7 @@ static int decode_channel_transform(WMAProDecodeCtx* s)
+
+ /** in the one channel case channel transforms are pointless */
+ s->num_chgroups = 0;
+- if (s->num_channels > 1) {
++ if (s->avctx->channels > 1) {
+ int remaining_channels = s->channels_for_cur_subframe;
+
+ if (get_bits1(&s->gb)) {
+@@ -718,7 +716,7 @@ static int decode_channel_transform(WMAProDecodeCtx* s)
+ }
+ } else {
+ chgroup->transform = 1;
+- if (s->num_channels == 2) {
++ if (s->avctx->channels == 2) {
+ chgroup->decorrelation_matrix[0] = 1.0;
+ chgroup->decorrelation_matrix[1] = -1.0;
+ chgroup->decorrelation_matrix[2] = 1.0;
+@@ -1008,7 +1006,7 @@ static void inverse_channel_transform(WMAProDecodeCtx *s)
+ (*ch)[y] = sum;
+ }
+ }
+- } else if (s->num_channels == 2) {
++ } else if (s->avctx->channels == 2) {
+ int len = FFMIN(sfb[1], s->subframe_len) - sfb[0];
+ s->dsp.vector_fmul_scalar(ch_data[0] + sfb[0],
+ ch_data[0] + sfb[0],
+@@ -1061,7 +1059,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
+ int offset = s->samples_per_frame;
+ int subframe_len = s->samples_per_frame;
+ int i;
+- int total_samples = s->samples_per_frame * s->num_channels;
++ int total_samples = s->samples_per_frame * s->avctx->channels;
+ int transmit_coeffs = 0;
+ int cur_subwoofer_cutoff;
+
+@@ -1071,7 +1069,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
+ == the next block of the channel with the smallest number of
+ decoded samples
+ */
+- for (i = 0; i < s->num_channels; i++) {
++ for (i = 0; i < s->avctx->channels; i++) {
+ s->channel[i].grouped = 0;
+ if (offset > s->channel[i].decoded_samples) {
+ offset = s->channel[i].decoded_samples;
+@@ -1085,7 +1083,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
+
+ /** get a list of all channels that contain the estimated block */
+ s->channels_for_cur_subframe = 0;
+- for (i = 0; i < s->num_channels; i++) {
++ for (i = 0; i < s->avctx->channels; i++) {
+ const int cur_subframe = s->channel[i].cur_subframe;
+ /** substract already processed samples */
+ total_samples -= s->channel[i].decoded_samples;
+@@ -1314,9 +1312,9 @@ static int decode_frame(WMAProDecodeCtx *s, int *got_frame_ptr)
+ }
+
+ /** read postproc transform */
+- if (s->num_channels > 1 && get_bits1(gb)) {
++ if (s->avctx->channels > 1 && get_bits1(gb)) {
+ if (get_bits1(gb)) {
+- for (i = 0; i < s->num_channels * s->num_channels; i++)
++ for (i = 0; i < avctx->channels * avctx->channels; i++)
+ skip_bits(gb, 4);
+ }
+ }
+@@ -1351,7 +1349,7 @@ static int decode_frame(WMAProDecodeCtx *s, int *got_frame_ptr)
+
+ /** reset subframe states */
+ s->parsed_all_subframes = 0;
+- for (i = 0; i < s->num_channels; i++) {
++ for (i = 0; i < avctx->channels; i++) {
+ s->channel[i].decoded_samples = 0;
+ s->channel[i].cur_subframe = 0;
+ s->channel[i].reuse_sf = 0;
+@@ -1374,11 +1372,11 @@ static int decode_frame(WMAProDecodeCtx *s, int *got_frame_ptr)
+ }
+
+ /** copy samples to the output buffer */
+- for (i = 0; i < s->num_channels; i++)
++ for (i = 0; i < avctx->channels; i++)
+ memcpy(s->frame.extended_data[i], s->channel[i].out,
+ s->samples_per_frame * sizeof(*s->channel[i].out));
+
+- for (i = 0; i < s->num_channels; i++) {
++ for (i = 0; i < avctx->channels; i++) {
+ /** reuse second half of the IMDCT output for the next frame */
+ memcpy(&s->channel[i].out[0],
+ &s->channel[i].out[s->samples_per_frame],
+@@ -1608,7 +1606,7 @@ static void flush(AVCodecContext *avctx)
+ int i;
+ /** reset output buffer as a part of it is used during the windowing of a
+ new frame */
+- for (i = 0; i < s->num_channels; i++)
++ for (i = 0; i < avctx->channels; i++)
+ memset(s->channel[i].out, 0, s->samples_per_frame *
+ sizeof(*s->channel[i].out));
+ s->packet_loss = 1;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0148-wmavoice-set-channel-layout.patch b/debian/patches/post-9beta2/0148-wmavoice-set-channel-layout.patch
new file mode 100644
index 0000000..0eb56bc
--- /dev/null
+++ b/debian/patches/post-9beta2/0148-wmavoice-set-channel-layout.patch
@@ -0,0 +1,33 @@
+From f7b8506573f28204d39cedc47d03bc5cda3be027 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 17:19:25 -0400
+Subject: [PATCH 148/204] wmavoice: set channel layout
+
+---
+ libavcodec/wmavoice.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
+index 466d1ec..df98167 100644
+--- a/libavcodec/wmavoice.c
++++ b/libavcodec/wmavoice.c
+@@ -29,6 +29,7 @@
+
+ #include <math.h>
+
++#include "libavutil/audioconvert.h"
+ #include "libavutil/mem.h"
+ #include "dsputil.h"
+ #include "avcodec.h"
+@@ -439,6 +440,8 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
+ 2 * (s->block_conv_table[1] - 2 * s->min_pitch_val);
+ s->block_pitch_nbits = av_ceil_log2(s->block_pitch_range);
+
++ ctx->channels = 1;
++ ctx->channel_layout = AV_CH_LAYOUT_MONO;
+ ctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+
+ avcodec_get_frame_defaults(&s->frame);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0149-ws-snd1-set-channel-layout.patch b/debian/patches/post-9beta2/0149-ws-snd1-set-channel-layout.patch
new file mode 100644
index 0000000..c8265d0
--- /dev/null
+++ b/debian/patches/post-9beta2/0149-ws-snd1-set-channel-layout.patch
@@ -0,0 +1,41 @@
+From 5459848b146f34defe894129ba1fc0d0572754f5 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 23 Oct 2012 17:22:53 -0400
+Subject: [PATCH 149/204] ws-snd1: set channel layout
+
+---
+ libavcodec/ws-snd1.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c
+index 880ae85..05cb31c 100644
+--- a/libavcodec/ws-snd1.c
++++ b/libavcodec/ws-snd1.c
+@@ -20,6 +20,8 @@
+ */
+
+ #include <stdint.h>
++
++#include "libavutil/audioconvert.h"
+ #include "libavutil/common.h"
+ #include "libavutil/intreadwrite.h"
+ #include "avcodec.h"
+@@ -46,12 +48,9 @@ static av_cold int ws_snd_decode_init(AVCodecContext *avctx)
+ {
+ WSSndContext *s = avctx->priv_data;
+
+- if (avctx->channels != 1) {
+- av_log_ask_for_sample(avctx, "unsupported number of channels\n");
+- return AVERROR(EINVAL);
+- }
+-
+- avctx->sample_fmt = AV_SAMPLE_FMT_U8;
++ avctx->channels = 1;
++ avctx->channel_layout = AV_CH_LAYOUT_MONO;
++ avctx->sample_fmt = AV_SAMPLE_FMT_U8;
+
+ avcodec_get_frame_defaults(&s->frame);
+ avctx->coded_frame = &s->frame;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0150-decode_audio3-initialize-AVFrame.patch b/debian/patches/post-9beta2/0150-decode_audio3-initialize-AVFrame.patch
new file mode 100644
index 0000000..af88a04
--- /dev/null
+++ b/debian/patches/post-9beta2/0150-decode_audio3-initialize-AVFrame.patch
@@ -0,0 +1,28 @@
+From 6d1270a0f9ededd37ed14bde52b8ee69b99e8a7f Mon Sep 17 00:00:00 2001
+From: Ilkka Ollakka <ileoo at videolan.org>
+Date: Wed, 31 Oct 2012 11:24:36 +0200
+Subject: [PATCH 150/204] decode_audio3: initialize AVFrame
+
+Same fix and issue as in a25d912dca9cd553440167e0476c47581359c0fc
+
+Signed-off-by: Anton Khirnov <anton at khirnov.net>
+---
+ libavcodec/utils.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/utils.c b/libavcodec/utils.c
+index 58dfe97..78726ae 100644
+--- a/libavcodec/utils.c
++++ b/libavcodec/utils.c
+@@ -1344,7 +1344,7 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
+ int *frame_size_ptr,
+ AVPacket *avpkt)
+ {
+- AVFrame frame;
++ AVFrame frame = {0};
+ int ret, got_frame = 0;
+
+ if (avctx->get_buffer != avcodec_default_get_buffer) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0151-doc-Point-to-the-new-location-of-the-c99-to-c89-tool.patch b/debian/patches/post-9beta2/0151-doc-Point-to-the-new-location-of-the-c99-to-c89-tool.patch
new file mode 100644
index 0000000..845a193
--- /dev/null
+++ b/debian/patches/post-9beta2/0151-doc-Point-to-the-new-location-of-the-c99-to-c89-tool.patch
@@ -0,0 +1,32 @@
+From c19e9d00a70616b86ae73111a7579a984c5fa585 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Thu, 1 Nov 2012 15:27:18 +0200
+Subject: [PATCH 151/204] doc: Point to the new location of the c99-to-c89
+ tool
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This location contains prebuilt binaries as well.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ doc/platform.texi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/doc/platform.texi b/doc/platform.texi
+index 6bb7136..999a5f1 100644
+--- a/doc/platform.texi
++++ b/doc/platform.texi
+@@ -109,7 +109,7 @@ wrapper.
+ You will need the following prerequisites:
+
+ @itemize
+- at item @uref{https://github.com/rbultje/c99-to-c89/, C99-to-C89 Converter & Wrapper}
++ at item @uref{https://github.com/libav/c99-to-c89/, C99-to-C89 Converter & Wrapper}
+ @item @uref{http://code.google.com/p/msinttypes/, msinttypes}
+ @item @uref{http://www.mingw.org/, MSYS}
+ @item @uref{http://yasm.tortall.net/, YASM}
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0152-a64-remove-interleaved-mode.patch b/debian/patches/post-9beta2/0152-a64-remove-interleaved-mode.patch
new file mode 100644
index 0000000..7d148d7
--- /dev/null
+++ b/debian/patches/post-9beta2/0152-a64-remove-interleaved-mode.patch
@@ -0,0 +1,165 @@
+From f70381ab9d53132be2d009d6db9649b3cad8288b Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 31 Oct 2012 22:32:36 +0100
+Subject: [PATCH 152/204] a64: remove interleaved mode.
+
+It has been disabled since it was added two years ago.
+---
+ libavformat/a64.c | 116 +----------------------------------------------------
+ 1 file changed, 2 insertions(+), 114 deletions(-)
+
+diff --git a/libavformat/a64.c b/libavformat/a64.c
+index 56b9a44..15a0475 100644
+--- a/libavformat/a64.c
++++ b/libavformat/a64.c
+@@ -23,17 +23,11 @@
+ #include "libavcodec/a64enc.h"
+ #include "libavcodec/bytestream.h"
+ #include "avformat.h"
+-
+-typedef struct A64MuxerContext {
+- int interleaved;
+- AVPacket prev_pkt;
+- int prev_frame_count;
+-} A64MuxerContext;
++#include "rawenc.h"
+
+ static int a64_write_header(struct AVFormatContext *s)
+ {
+ AVCodecContext *avctx = s->streams[0]->codec;
+- A64MuxerContext *c = s->priv_data;
+ uint8_t header[5] = {
+ 0x00, //load
+ 0x40, //address
+@@ -41,7 +35,6 @@ static int a64_write_header(struct AVFormatContext *s)
+ 0x00, //charset_lifetime (multi only)
+ 0x00 //fps in 50/fps;
+ };
+- c->interleaved = 0;
+ switch (avctx->codec->id) {
+ case AV_CODEC_ID_A64_MULTI:
+ header[2] = 0x00;
+@@ -57,109 +50,6 @@ static int a64_write_header(struct AVFormatContext *s)
+ return AVERROR(EINVAL);
+ }
+ avio_write(s->pb, header, 2);
+- c->prev_pkt.size = 0;
+- c->prev_frame_count = 0;
+- return 0;
+-}
+-
+-static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt)
+-{
+- AVCodecContext *avctx = s->streams[0]->codec;
+- A64MuxerContext *c = s->priv_data;
+- int i, j;
+- int ch_chunksize;
+- int lifetime;
+- int frame_count;
+- int charset_size;
+- int frame_size;
+- int num_frames;
+-
+- /* fetch values from extradata */
+- switch (avctx->codec->id) {
+- case AV_CODEC_ID_A64_MULTI:
+- case AV_CODEC_ID_A64_MULTI5:
+- if(c->interleaved) {
+- /* Write interleaved, means we insert chunks of the future charset before each current frame.
+- * Reason: if we load 1 charset + corresponding frames in one block on c64, we need to store
+- * them first and then display frame by frame to keep in sync. Thus we would read and write
+- * the data for colram from/to ram first and waste too much time. If we interleave and send the
+- * charset beforehand, we assemble a new charset chunk by chunk, write current screen data to
+- * screen-ram to be displayed and decode the colram directly to colram-location $d800 during
+- * the overscan, while reading directly from source.
+- * This is the only way so far, to achieve 25fps on c64 */
+- if(avctx->extradata) {
+- /* fetch values from extradata */
+- lifetime = AV_RB32(avctx->extradata + 0);
+- frame_count = AV_RB32(avctx->extradata + 4);
+- charset_size = AV_RB32(avctx->extradata + 8);
+- frame_size = AV_RB32(avctx->extradata + 12);
+-
+- /* TODO: sanity checks? */
+- } else {
+- av_log(avctx, AV_LOG_ERROR, "extradata not set\n");
+- return AVERROR(EINVAL);
+- }
+-
+- ch_chunksize=charset_size/lifetime;
+- /* TODO: check if charset/size is % lifetime, but maybe check in codec */
+-
+- if(pkt->data) num_frames = lifetime;
+- else num_frames = c->prev_frame_count;
+-
+- for(i = 0; i < num_frames; i++) {
+- if(pkt->data) {
+- /* if available, put newest charset chunk into buffer */
+- avio_write(s->pb, pkt->data + ch_chunksize * i, ch_chunksize);
+- } else {
+- /* a bit ugly, but is there an alternative to put many zeros? */
+- for(j = 0; j < ch_chunksize; j++) avio_w8(s->pb, 0);
+- }
+-
+- if(c->prev_pkt.data) {
+- /* put frame (screen + colram) from last packet into buffer */
+- avio_write(s->pb, c->prev_pkt.data + charset_size + frame_size * i, frame_size);
+- } else {
+- /* a bit ugly, but is there an alternative to put many zeros? */
+- for(j = 0; j < frame_size; j++) avio_w8(s->pb, 0);
+- }
+- }
+-
+- /* backup current packet for next turn */
+- if(pkt->data) {
+- /* no backup packet yet? create one! */
+- if(!c->prev_pkt.data) av_new_packet(&c->prev_pkt, pkt->size);
+- /* we have a packet and data is big enough, reuse it */
+- if(c->prev_pkt.data && c->prev_pkt.size >= pkt->size) {
+- memcpy(c->prev_pkt.data, pkt->data, pkt->size);
+- c->prev_pkt.size = pkt->size;
+- } else {
+- av_log(avctx, AV_LOG_ERROR, "Too less memory for prev_pkt.\n");
+- return AVERROR(ENOMEM);
+- }
+- }
+-
+- c->prev_frame_count = frame_count;
+- break;
+- }
+- default:
+- /* Write things as is. Nice for self-contained frames from non-multicolor modes or if played
+- * directly from ram and not from a streaming device (rrnet/mmc) */
+- if(pkt) avio_write(s->pb, pkt->data, pkt->size);
+- break;
+- }
+-
+- avio_flush(s->pb);
+- return 0;
+-}
+-
+-static int a64_write_trailer(struct AVFormatContext *s)
+-{
+- A64MuxerContext *c = s->priv_data;
+- AVPacket pkt = {0};
+- /* need to flush last packet? */
+- if(c->interleaved) a64_write_packet(s, &pkt);
+- /* discard backed up packet */
+- if(c->prev_pkt.data) av_destruct_packet(&c->prev_pkt);
+ return 0;
+ }
+
+@@ -167,9 +57,7 @@ AVOutputFormat ff_a64_muxer = {
+ .name = "a64",
+ .long_name = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"),
+ .extensions = "a64, A64",
+- .priv_data_size = sizeof (A64Context),
+ .video_codec = AV_CODEC_ID_A64_MULTI,
+ .write_header = a64_write_header,
+- .write_packet = a64_write_packet,
+- .write_trailer = a64_write_trailer,
++ .write_packet = ff_raw_write_packet,
+ };
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0153-rtpdec-factorize-identical-code-used-in-several-hand.patch b/debian/patches/post-9beta2/0153-rtpdec-factorize-identical-code-used-in-several-hand.patch
new file mode 100644
index 0000000..2bd5fb4
--- /dev/null
+++ b/debian/patches/post-9beta2/0153-rtpdec-factorize-identical-code-used-in-several-hand.patch
@@ -0,0 +1,205 @@
+From 179a5c37e070f619f14289bdc0fa66a08219eed9 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Thu, 1 Nov 2012 14:03:04 +0100
+Subject: [PATCH 153/204] rtpdec: factorize identical code used in several
+ handlers
+
+---
+ libavformat/rtpdec.c | 11 +++++++++++
+ libavformat/rtpdec.h | 5 +++++
+ libavformat/rtpdec_h263_rfc2190.c | 12 +++++-------
+ libavformat/rtpdec_jpeg.c | 13 +++----------
+ libavformat/rtpdec_svq3.c | 9 ++++-----
+ libavformat/rtpdec_vp8.c | 13 +++----------
+ libavformat/rtpdec_xiph.c | 13 +++----------
+ 7 files changed, 34 insertions(+), 42 deletions(-)
+
+diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
+index d16122d..a305dd6 100644
+--- a/libavformat/rtpdec.c
++++ b/libavformat/rtpdec.c
+@@ -803,3 +803,14 @@ int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p,
+ av_free(value);
+ return 0;
+ }
++
++int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx)
++{
++ av_init_packet(pkt);
++
++ pkt->size = avio_close_dyn_buf(*dyn_buf, &pkt->data);
++ pkt->stream_index = stream_idx;
++ pkt->destruct = av_destruct_packet;
++ *dyn_buf = NULL;
++ return pkt->size;
++}
+diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h
+index 7f14aa2..da3680d 100644
+--- a/libavformat/rtpdec.h
++++ b/libavformat/rtpdec.h
+@@ -202,4 +202,9 @@ int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p,
+
+ void av_register_rtp_dynamic_payload_handlers(void);
+
++/**
++ * Close the dynamic buffer and make a packet from it.
++ */
++int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx);
++
+ #endif /* AVFORMAT_RTPDEC_H */
+diff --git a/libavformat/rtpdec_h263_rfc2190.c b/libavformat/rtpdec_h263_rfc2190.c
+index 163d4ea..4957b33 100644
+--- a/libavformat/rtpdec_h263_rfc2190.c
++++ b/libavformat/rtpdec_h263_rfc2190.c
+@@ -61,7 +61,7 @@ static int h263_handle_packet(AVFormatContext *ctx, PayloadContext *data,
+ {
+ /* Corresponding to header fields in the RFC */
+ int f, p, i, sbit, ebit, src, r;
+- int header_size;
++ int header_size, ret;
+
+ if (data->newformat)
+ return ff_h263_handle_packet(ctx, data, st, pkt, timestamp, buf, len,
+@@ -133,7 +133,7 @@ static int h263_handle_packet(AVFormatContext *ctx, PayloadContext *data,
+ /* Check the picture start code, only start buffering a new frame
+ * if this is correct */
+ if (len > 4 && AV_RB32(buf) >> 10 == 0x20) {
+- int ret = avio_open_dyn_buf(&data->buf);
++ ret = avio_open_dyn_buf(&data->buf);
+ if (ret < 0)
+ return ret;
+ data->timestamp = *timestamp;
+@@ -185,13 +185,11 @@ static int h263_handle_packet(AVFormatContext *ctx, PayloadContext *data,
+ avio_w8(data->buf, data->endbyte);
+ data->endbyte_bits = 0;
+
+- av_init_packet(pkt);
+- pkt->size = avio_close_dyn_buf(data->buf, &pkt->data);
+- pkt->destruct = av_destruct_packet;
+- pkt->stream_index = st->index;
++ ret = ff_rtp_finalize_packet(pkt, &data->buf, st->index);
++ if (ret < 0)
++ return ret;
+ if (!i)
+ pkt->flags |= AV_PKT_FLAG_KEY;
+- data->buf = NULL;
+
+ return 0;
+ }
+diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c
+index 944758d..9f73f7d 100644
+--- a/libavformat/rtpdec_jpeg.c
++++ b/libavformat/rtpdec_jpeg.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include "avformat.h"
++#include "rtpdec.h"
+ #include "rtpdec_formats.h"
+ #include "libavutil/intreadwrite.h"
+ #include "libavcodec/mjpeg.h"
+@@ -367,19 +368,11 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
+ avio_write(jpeg->frame, buf, sizeof(buf));
+
+ /* Prepare the JPEG packet. */
+- av_init_packet(pkt);
+- pkt->size = avio_close_dyn_buf(jpeg->frame, &pkt->data);
+- if (pkt->size < 0) {
++ if ((ret = ff_rtp_finalize_packet(pkt, &jpeg->frame, st->index)) < 0) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Error occured when getting frame buffer.\n");
+- jpeg->frame = NULL;
+- return pkt->size;
++ return ret;
+ }
+- pkt->stream_index = st->index;
+- pkt->destruct = av_destruct_packet;
+-
+- /* Re-init the frame buffer. */
+- jpeg->frame = NULL;
+
+ return 0;
+ }
+diff --git a/libavformat/rtpdec_svq3.c b/libavformat/rtpdec_svq3.c
+index bfc602e..087a1e3 100644
+--- a/libavformat/rtpdec_svq3.c
++++ b/libavformat/rtpdec_svq3.c
+@@ -97,12 +97,11 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv,
+ avio_write(sv->pktbuf, buf, len);
+
+ if (end_packet) {
+- av_init_packet(pkt);
+- pkt->stream_index = st->index;
++ int ret = ff_rtp_finalize_packet(pkt, &sv->pktbuf, st->index);
++ if (ret < 0)
++ return ret;
++
+ *timestamp = sv->timestamp;
+- pkt->size = avio_close_dyn_buf(sv->pktbuf, &pkt->data);
+- pkt->destruct = av_destruct_packet;
+- sv->pktbuf = NULL;
+ return 0;
+ }
+
+diff --git a/libavformat/rtpdec_vp8.c b/libavformat/rtpdec_vp8.c
+index a52be4b..541a1bc 100644
+--- a/libavformat/rtpdec_vp8.c
++++ b/libavformat/rtpdec_vp8.c
+@@ -36,15 +36,6 @@ struct PayloadContext {
+ uint32_t timestamp;
+ };
+
+-static void prepare_packet(AVPacket *pkt, PayloadContext *vp8, int stream)
+-{
+- av_init_packet(pkt);
+- pkt->stream_index = stream;
+- pkt->size = avio_close_dyn_buf(vp8->data, &pkt->data);
+- pkt->destruct = av_destruct_packet;
+- vp8->data = NULL;
+-}
+-
+ static int vp8_handle_packet(AVFormatContext *ctx,
+ PayloadContext *vp8,
+ AVStream *st,
+@@ -133,7 +124,9 @@ static int vp8_handle_packet(AVFormatContext *ctx,
+ avio_write(vp8->data, buf, len);
+
+ if (end_packet) {
+- prepare_packet(pkt, vp8, st->index);
++ int ret = ff_rtp_finalize_packet(pkt, &vp8->data, st->index);
++ if (ret < 0)
++ return ret;
+ return 0;
+ }
+
+diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
+index 38f12bb..40415d8 100644
+--- a/libavformat/rtpdec_xiph.c
++++ b/libavformat/rtpdec_xiph.c
+@@ -202,20 +202,13 @@ static int xiph_handle_packet(AVFormatContext * ctx,
+
+ if (fragmented == 3) {
+ // end of xiph data packet
+- av_init_packet(pkt);
+- pkt->size = avio_close_dyn_buf(data->fragment, &pkt->data);
+-
+- if (pkt->size < 0) {
++ int ret = ff_rtp_finalize_packet(pkt, &data->fragment, st->index);
++ if (ret < 0) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Error occurred when getting fragment buffer.");
+- return pkt->size;
++ return ret;
+ }
+
+- pkt->stream_index = st->index;
+- pkt->destruct = av_destruct_packet;
+-
+- data->fragment = NULL;
+-
+ return 0;
+ }
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0154-audiointerleave-deobfuscate-a-function-call.patch b/debian/patches/post-9beta2/0154-audiointerleave-deobfuscate-a-function-call.patch
new file mode 100644
index 0000000..b560cfa
--- /dev/null
+++ b/debian/patches/post-9beta2/0154-audiointerleave-deobfuscate-a-function-call.patch
@@ -0,0 +1,25 @@
+From fdc867288697d8b052145e80911d2d338d7d02b7 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 31 Oct 2012 22:10:41 +0100
+Subject: [PATCH 154/204] audiointerleave: deobfuscate a function call.
+
+right above there is if (pkt) {<do stuff>; pkt = NULL}, so pkt is just a
+fancy name for NULL at this point.
+---
+ libavformat/audiointerleave.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavformat/audiointerleave.c b/libavformat/audiointerleave.c
+index e48f826..5df0bb0 100644
+--- a/libavformat/audiointerleave.c
++++ b/libavformat/audiointerleave.c
+@@ -130,5 +130,5 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt
+ }
+ }
+
+- return get_packet(s, out, pkt, flush);
++ return get_packet(s, out, NULL, flush);
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0155-lavc-add-some-AVPacket-doxy.patch b/debian/patches/post-9beta2/0155-lavc-add-some-AVPacket-doxy.patch
new file mode 100644
index 0000000..d8c6945
--- /dev/null
+++ b/debian/patches/post-9beta2/0155-lavc-add-some-AVPacket-doxy.patch
@@ -0,0 +1,45 @@
+From 0876c28080750e0978ba77c3f72cdd2b0d069a6f Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 31 Oct 2012 17:27:24 +0100
+Subject: [PATCH 155/204] lavc: add some AVPacket doxy.
+
+---
+ libavcodec/avcodec.h | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
+index d6a4e4d..73321b2 100644
+--- a/libavcodec/avcodec.h
++++ b/libavcodec/avcodec.h
+@@ -872,6 +872,28 @@ enum AVPacketSideDataType {
+ AV_PKT_DATA_H263_MB_INFO,
+ };
+
++/**
++ * This structure stores compressed data. It is typically exported by demuxers
++ * and then passed as input to decoders, or received as output from encoders and
++ * then passed to muxers.
++ *
++ * For video, it should typically contain one compressed frame. For audio it may
++ * contain several compressed frames.
++ *
++ * AVPacket is one of the few structs in Libav, whose size is a part of public
++ * ABI. Thus it may be allocated on stack and no new fields can be added to it
++ * without libavcodec and libavformat major bump.
++ *
++ * The semantics of data ownership depends on the destruct field.
++ * If it is set, the packet data is dynamically allocated and is valid
++ * indefinitely until av_free_packet() is called (which in turn calls the
++ * destruct callback to free the data). If destruct is not set, the packet data
++ * is typically backed by some static buffer somewhere and is only valid for a
++ * limited time (e.g. until the next read call when demuxing).
++ *
++ * The side data is always allocated with av_malloc() and is freed in
++ * av_free_packet().
++ */
+ typedef struct AVPacket {
+ /**
+ * Presentation timestamp in AVStream->time_base units; the time at which
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0156-rtpdec_vp8-Don-t-parse-fields-that-aren-t-used.patch b/debian/patches/post-9beta2/0156-rtpdec_vp8-Don-t-parse-fields-that-aren-t-used.patch
new file mode 100644
index 0000000..c55011b
--- /dev/null
+++ b/debian/patches/post-9beta2/0156-rtpdec_vp8-Don-t-parse-fields-that-aren-t-used.patch
@@ -0,0 +1,77 @@
+From 2b831a59d9ea82ef5d906a58b11c41f51029b16e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 9 Oct 2012 01:17:45 +0300
+Subject: [PATCH 156/204] rtpdec_vp8: Don't parse fields that aren't used
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This avoids warnings about unused variables.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavformat/rtpdec_vp8.c | 25 ++++++-------------------
+ 1 file changed, 6 insertions(+), 19 deletions(-)
+
+diff --git a/libavformat/rtpdec_vp8.c b/libavformat/rtpdec_vp8.c
+index 541a1bc..a364358 100644
+--- a/libavformat/rtpdec_vp8.c
++++ b/libavformat/rtpdec_vp8.c
+@@ -45,16 +45,14 @@ static int vp8_handle_packet(AVFormatContext *ctx,
+ int len, int flags)
+ {
+ int start_partition, end_packet;
+- int extended_bits, non_ref, part_id;
++ int extended_bits, part_id;
+ int pictureid_present = 0, tl0picidx_present = 0, tid_present = 0,
+ keyidx_present = 0;
+- int pictureid = -1, keyidx = -1;
+
+ if (len < 1)
+ return AVERROR_INVALIDDATA;
+
+ extended_bits = buf[0] & 0x80;
+- non_ref = buf[0] & 0x20;
+ start_partition = buf[0] & 0x10;
+ part_id = buf[0] & 0x0f;
+ end_packet = flags & RTP_FLAG_MARKER;
+@@ -71,19 +69,12 @@ static int vp8_handle_packet(AVFormatContext *ctx,
+ len--;
+ }
+ if (pictureid_present) {
++ int size;
+ if (len < 1)
+ return AVERROR_INVALIDDATA;
+- if (buf[0] & 0x80) {
+- if (len < 2)
+- return AVERROR_INVALIDDATA;
+- pictureid = AV_RB16(buf) & 0x7fff;
+- buf += 2;
+- len -= 2;
+- } else {
+- pictureid = buf[0] & 0x7f;
+- buf++;
+- len--;
+- }
++ size = buf[0] & 0x80 ? 2 : 1;
++ buf += size;
++ len -= size;
+ }
+ if (tl0picidx_present) {
+ // Ignoring temporal level zero index
+@@ -91,11 +82,7 @@ static int vp8_handle_packet(AVFormatContext *ctx,
+ len--;
+ }
+ if (tid_present || keyidx_present) {
+- // Ignoring temporal layer index and layer sync bit
+- if (len < 1)
+- return AVERROR_INVALIDDATA;
+- if (keyidx_present)
+- keyidx = buf[0] & 0x1f;
++ // Ignoring temporal layer index, layer sync bit and keyframe index
+ buf++;
+ len--;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0157-dv1394-Swap-the-min-and-max-values-of-the-standard-o.patch b/debian/patches/post-9beta2/0157-dv1394-Swap-the-min-and-max-values-of-the-standard-o.patch
new file mode 100644
index 0000000..a84b52e
--- /dev/null
+++ b/debian/patches/post-9beta2/0157-dv1394-Swap-the-min-and-max-values-of-the-standard-o.patch
@@ -0,0 +1,32 @@
+From e1c804d883f3cca1b492147a2ac5d0aea7460076 Mon Sep 17 00:00:00 2001
+From: Michael Niedermayer <michaelni at gmx.at>
+Date: Fri, 2 Nov 2012 02:07:15 +0100
+Subject: [PATCH 157/204] dv1394: Swap the min and max values of the
+ 'standard' option
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+DV1394_NTSC has a lower value than DV1394_PAL.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavdevice/dv1394.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c
+index 4a63768..ce8efa6 100644
+--- a/libavdevice/dv1394.c
++++ b/libavdevice/dv1394.c
+@@ -211,7 +211,7 @@ static int dv1394_close(AVFormatContext * context)
+ }
+
+ static const AVOption options[] = {
+- { "standard", "", offsetof(struct dv1394_data, format), AV_OPT_TYPE_INT, {.i64 = DV1394_NTSC}, DV1394_PAL, DV1394_NTSC, AV_OPT_FLAG_DECODING_PARAM, "standard" },
++ { "standard", "", offsetof(struct dv1394_data, format), AV_OPT_TYPE_INT, {.i64 = DV1394_NTSC}, DV1394_NTSC, DV1394_PAL, AV_OPT_FLAG_DECODING_PARAM, "standard" },
+ { "PAL", "", 0, AV_OPT_TYPE_CONST, {.i64 = DV1394_PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
+ { "NTSC", "", 0, AV_OPT_TYPE_CONST, {.i64 = DV1394_NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
+ { "channel", "", offsetof(struct dv1394_data, channel), AV_OPT_TYPE_INT, {.i64 = DV1394_DEFAULT_CHANNEL}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0158-x86inc-Only-define-program_name-if-the-macro-is-unse.patch b/debian/patches/post-9beta2/0158-x86inc-Only-define-program_name-if-the-macro-is-unse.patch
new file mode 100644
index 0000000..a86c081
--- /dev/null
+++ b/debian/patches/post-9beta2/0158-x86inc-Only-define-program_name-if-the-macro-is-unse.patch
@@ -0,0 +1,29 @@
+From 012f73e271638430e035ca68f5803dc2356d6a3e Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Tue, 30 Oct 2012 02:54:25 +0100
+Subject: [PATCH 158/204] x86inc: Only define program_name if the macro is
+ unset
+
+This allows overriding the value from outside of the file.
+---
+ libavutil/x86/x86inc.asm | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
+index 1fe9f55..b0df2b2 100644
+--- a/libavutil/x86/x86inc.asm
++++ b/libavutil/x86/x86inc.asm
+@@ -34,7 +34,9 @@
+ ; as this feature might be useful for others as well. Send patches or ideas
+ ; to x264-devel at videolan.org .
+
+-%define program_name ff
++%ifndef program_name
++ %define program_name ff
++%endif
+
+ %define WIN64 0
+ %define UNIX64 0
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0159-x86util-Add-cpuflags_mmxext-alias-for-cpuflags_mmx2.patch b/debian/patches/post-9beta2/0159-x86util-Add-cpuflags_mmxext-alias-for-cpuflags_mmx2.patch
new file mode 100644
index 0000000..6a8816b
--- /dev/null
+++ b/debian/patches/post-9beta2/0159-x86util-Add-cpuflags_mmxext-alias-for-cpuflags_mmx2.patch
@@ -0,0 +1,26 @@
+From 61bc2bc7d428cafe45f6d9ab40e6c05262d307e9 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Tue, 30 Oct 2012 01:11:14 +0100
+Subject: [PATCH 159/204] x86util: Add cpuflags_mmxext alias for cpuflags_mmx2
+
+"mmxext" is a more sensible name and more common in outside projects.
+---
+ libavutil/x86/x86util.asm | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index 4c6f4c6..761cea0 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -23,6 +23,8 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
++%define cpuflags_mmxext cpuflags_mmx2
++
+ %include "libavutil/x86/x86inc.asm"
+
+ %macro SBUTTERFLY 4
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0160-x86-ac3dsp-port-to-cpuflags.patch b/debian/patches/post-9beta2/0160-x86-ac3dsp-port-to-cpuflags.patch
new file mode 100644
index 0000000..5aff748
--- /dev/null
+++ b/debian/patches/post-9beta2/0160-x86-ac3dsp-port-to-cpuflags.patch
@@ -0,0 +1,200 @@
+From 9ce02e14f01de50fcc6f7f459544b140be66d615 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 15 Jul 2012 15:41:30 +0200
+Subject: [PATCH 160/204] x86: ac3dsp: port to cpuflags
+
+---
+ libavcodec/x86/ac3dsp.asm | 84 ++++++++++++++++++++++-----------------------
+ 1 file changed, 42 insertions(+), 42 deletions(-)
+
+diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
+index 0c00759..9d66fda 100644
+--- a/libavcodec/x86/ac3dsp.asm
++++ b/libavcodec/x86/ac3dsp.asm
+@@ -41,8 +41,8 @@ SECTION .text
+ ; void ff_ac3_exponent_min(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
+ ;-----------------------------------------------------------------------------
+
+-%macro AC3_EXPONENT_MIN 1
+-cglobal ac3_exponent_min_%1, 3,4,2, exp, reuse_blks, expn, offset
++%macro AC3_EXPONENT_MIN 0
++cglobal ac3_exponent_min, 3, 4, 2, exp, reuse_blks, expn, offset
+ shl reuse_blksq, 8
+ jz .end
+ LOOP_ALIGN
+@@ -65,16 +65,17 @@ cglobal ac3_exponent_min_%1, 3,4,2, exp, reuse_blks, expn, offset
+
+ %define PMINUB PMINUB_MMX
+ %define LOOP_ALIGN
+-INIT_MMX
+-AC3_EXPONENT_MIN mmx
++INIT_MMX mmx
++AC3_EXPONENT_MIN
+ %if HAVE_MMXEXT
+ %define PMINUB PMINUB_MMXEXT
+ %define LOOP_ALIGN ALIGN 16
+-AC3_EXPONENT_MIN mmxext
++INIT_MMX mmxext
++AC3_EXPONENT_MIN
+ %endif
+ %if HAVE_SSE2_EXTERNAL
+-INIT_XMM
+-AC3_EXPONENT_MIN sse2
++INIT_XMM sse2
++AC3_EXPONENT_MIN
+ %endif
+ %undef PMINUB
+ %undef LOOP_ALIGN
+@@ -168,8 +169,8 @@ AC3_MAX_MSB_ABS_INT16 or_abs
+ ; macro used for ff_ac3_lshift_int16() and ff_ac3_rshift_int32()
+ ;-----------------------------------------------------------------------------
+
+-%macro AC3_SHIFT 4 ; l/r, 16/32, shift instruction, instruction set
+-cglobal ac3_%1shift_int%2_%4, 3,3,5, src, len, shift
++%macro AC3_SHIFT 3 ; l/r, 16/32, shift instruction, instruction set
++cglobal ac3_%1shift_int%2, 3, 3, 5, src, len, shift
+ movd m0, shiftd
+ .loop:
+ mova m1, [srcq ]
+@@ -195,19 +196,19 @@ cglobal ac3_%1shift_int%2_%4, 3,3,5, src, len, shift
+ ; void ff_ac3_lshift_int16(int16_t *src, unsigned int len, unsigned int shift)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
+-AC3_SHIFT l, 16, psllw, mmx
+-INIT_XMM
+-AC3_SHIFT l, 16, psllw, sse2
++INIT_MMX mmx
++AC3_SHIFT l, 16, psllw
++INIT_XMM sse2
++AC3_SHIFT l, 16, psllw
+
+ ;-----------------------------------------------------------------------------
+ ; void ff_ac3_rshift_int32(int32_t *src, unsigned int len, unsigned int shift)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
+-AC3_SHIFT r, 32, psrad, mmx
+-INIT_XMM
+-AC3_SHIFT r, 32, psrad, sse2
++INIT_MMX mmx
++AC3_SHIFT r, 32, psrad
++INIT_XMM sse2
++AC3_SHIFT r, 32, psrad
+
+ ;-----------------------------------------------------------------------------
+ ; void ff_float_to_fixed24(int32_t *dst, const float *src, unsigned int len)
+@@ -215,8 +216,8 @@ AC3_SHIFT r, 32, psrad, sse2
+
+ ; The 3DNow! version is not bit-identical because pf2id uses truncation rather
+ ; than round-to-nearest.
+-INIT_MMX
+-cglobal float_to_fixed24_3dnow, 3,3,0, dst, src, len
++INIT_MMX 3dnow
++cglobal float_to_fixed24, 3, 3, 0, dst, src, len
+ movq m0, [pf_1_24]
+ .loop:
+ movq m1, [srcq ]
+@@ -242,8 +243,8 @@ cglobal float_to_fixed24_3dnow, 3,3,0, dst, src, len
+ femms
+ RET
+
+-INIT_XMM
+-cglobal float_to_fixed24_sse, 3,3,3, dst, src, len
++INIT_XMM sse
++cglobal float_to_fixed24, 3, 3, 3, dst, src, len
+ movaps m0, [pf_1_24]
+ .loop:
+ movaps m1, [srcq ]
+@@ -267,8 +268,8 @@ cglobal float_to_fixed24_sse, 3,3,3, dst, src, len
+ emms
+ RET
+
+-INIT_XMM
+-cglobal float_to_fixed24_sse2, 3,3,9, dst, src, len
++INIT_XMM sse2
++cglobal float_to_fixed24, 3, 3, 9, dst, src, len
+ movaps m0, [pf_1_24]
+ .loop:
+ movaps m1, [srcq ]
+@@ -332,8 +333,8 @@ cglobal float_to_fixed24_sse2, 3,3,9, dst, src, len
+ paddd %1, %2
+ %endmacro
+
+-INIT_XMM
+-cglobal ac3_compute_mantissa_size_sse2, 1,2,4, mant_cnt, sum
++INIT_XMM sse2
++cglobal ac3_compute_mantissa_size, 1, 2, 4, mant_cnt, sum
+ movdqa m0, [mant_cntq ]
+ movdqa m1, [mant_cntq+ 1*16]
+ paddw m0, [mant_cntq+ 2*16]
+@@ -373,20 +374,20 @@ cglobal ac3_compute_mantissa_size_sse2, 1,2,4, mant_cnt, sum
+ ; void ff_ac3_extract_exponents(uint8_t *exp, int32_t *coef, int nb_coefs)
+ ;------------------------------------------------------------------------------
+
+-%macro PABSD_MMX 2 ; src/dst, tmp
++%macro PABSD 1-2 ; src/dst, unused
++%if cpuflag(ssse3)
++ pabsd %1, %1
++%else ; src/dst, tmp
+ pxor %2, %2
+ pcmpgtd %2, %1
+ pxor %1, %2
+ psubd %1, %2
+-%endmacro
+-
+-%macro PABSD_SSSE3 1-2 ; src/dst, unused
+- pabsd %1, %1
++%endif
+ %endmacro
+
+ %if HAVE_AMD3DNOW_EXTERNAL
+-INIT_MMX
+-cglobal ac3_extract_exponents_3dnow, 3,3,0, exp, coef, len
++INIT_MMX 3dnow
++cglobal ac3_extract_exponents, 3, 3, 0, exp, coef, len
+ add expq, lenq
+ lea coefq, [coefq+4*lenq]
+ neg lenq
+@@ -395,8 +396,8 @@ cglobal ac3_extract_exponents_3dnow, 3,3,0, exp, coef, len
+ .loop:
+ movq m0, [coefq+4*lenq ]
+ movq m1, [coefq+4*lenq+8]
+- PABSD_MMX m0, m2
+- PABSD_MMX m1, m2
++ PABSD m0, m2
++ PABSD m1, m2
+ pslld m0, 1
+ por m0, m3
+ pi2fd m2, m0
+@@ -420,8 +421,8 @@ cglobal ac3_extract_exponents_3dnow, 3,3,0, exp, coef, len
+ REP_RET
+ %endif
+
+-%macro AC3_EXTRACT_EXPONENTS 1
+-cglobal ac3_extract_exponents_%1, 3,3,4, exp, coef, len
++%macro AC3_EXTRACT_EXPONENTS 0
++cglobal ac3_extract_exponents, 3, 3, 4, exp, coef, len
+ add expq, lenq
+ lea coefq, [coefq+4*lenq]
+ neg lenq
+@@ -453,11 +454,10 @@ cglobal ac3_extract_exponents_%1, 3,3,4, exp, coef, len
+ %endmacro
+
+ %if HAVE_SSE2_EXTERNAL
+-INIT_XMM
+-%define PABSD PABSD_MMX
+-AC3_EXTRACT_EXPONENTS sse2
+-%if HAVE_SSSE3_EXTERNAL
+-%define PABSD PABSD_SSSE3
+-AC3_EXTRACT_EXPONENTS ssse3
++INIT_XMM sse2
++AC3_EXTRACT_EXPONENTS
+ %endif
++%if HAVE_SSSE3_EXTERNAL
++INIT_XMM ssse3
++AC3_EXTRACT_EXPONENTS
+ %endif
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0161-x86-PMINUB-port-to-cpuflags.patch b/debian/patches/post-9beta2/0161-x86-PMINUB-port-to-cpuflags.patch
new file mode 100644
index 0000000..66a4a7b
--- /dev/null
+++ b/debian/patches/post-9beta2/0161-x86-PMINUB-port-to-cpuflags.patch
@@ -0,0 +1,62 @@
+From 26f01bd106f62ffe501a9baf609c476051d919da Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 15 Jul 2012 17:43:50 +0200
+Subject: [PATCH 161/204] x86: PMINUB: port to cpuflags
+
+---
+ libavcodec/x86/ac3dsp.asm | 3 ---
+ libavutil/x86/x86util.asm | 10 +++++-----
+ 2 files changed, 5 insertions(+), 8 deletions(-)
+
+diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
+index 9d66fda..2c453c5 100644
+--- a/libavcodec/x86/ac3dsp.asm
++++ b/libavcodec/x86/ac3dsp.asm
+@@ -63,12 +63,10 @@ cglobal ac3_exponent_min, 3, 4, 2, exp, reuse_blks, expn, offset
+ REP_RET
+ %endmacro
+
+-%define PMINUB PMINUB_MMX
+ %define LOOP_ALIGN
+ INIT_MMX mmx
+ AC3_EXPONENT_MIN
+ %if HAVE_MMXEXT
+-%define PMINUB PMINUB_MMXEXT
+ %define LOOP_ALIGN ALIGN 16
+ INIT_MMX mmxext
+ AC3_EXPONENT_MIN
+@@ -77,7 +75,6 @@ AC3_EXPONENT_MIN
+ INIT_XMM sse2
+ AC3_EXPONENT_MIN
+ %endif
+-%undef PMINUB
+ %undef LOOP_ALIGN
+
+ ;-----------------------------------------------------------------------------
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index 761cea0..ca0041a 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -530,14 +530,14 @@
+ movh [%7+%8], %4
+ %endmacro
+
+-%macro PMINUB_MMX 3 ; dst, src, tmp
++%macro PMINUB 3 ; dst, src, ignored
++%if cpuflag(mmxext)
++ pminub %1, %2
++%else ; dst, src, tmp
+ mova %3, %1
+ psubusb %3, %2
+ psubb %1, %3
+-%endmacro
+-
+-%macro PMINUB_MMXEXT 3 ; dst, src, ignored
+- pminub %1, %2
++%endif
+ %endmacro
+
+ %macro SPLATW 2-3 0
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0162-PGS-subtitles-Expose-forced-flag.patch b/debian/patches/post-9beta2/0162-PGS-subtitles-Expose-forced-flag.patch
new file mode 100644
index 0000000..fbfff0d
--- /dev/null
+++ b/debian/patches/post-9beta2/0162-PGS-subtitles-Expose-forced-flag.patch
@@ -0,0 +1,95 @@
+From 85f67c4865d8014ded2aaa64b3cba6e2970342d7 Mon Sep 17 00:00:00 2001
+From: John Stebbins <jstebbins.hb at gmail.com>
+Date: Sat, 20 Oct 2012 09:56:11 -0700
+Subject: [PATCH 162/204] PGS subtitles: Expose forced flag
+
+Useful for detection of subtitles displayed during foreign language
+scenes.
+
+Signed-off-by: Diego Biurrun <diego at biurrun.de>
+---
+ libavcodec/avcodec.h | 3 +++
+ libavcodec/pgssubdec.c | 11 ++++++++---
+ libavcodec/version.h | 2 +-
+ 3 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
+index 73321b2..43f7c87 100644
+--- a/libavcodec/avcodec.h
++++ b/libavcodec/avcodec.h
+@@ -3166,6 +3166,8 @@ enum AVSubtitleType {
+ SUBTITLE_ASS,
+ };
+
++#define AV_SUBTITLE_FLAG_FORCED 0x00000001
++
+ typedef struct AVSubtitleRect {
+ int x; ///< top left corner of pict, undefined when pict is not set
+ int y; ///< top left corner of pict, undefined when pict is not set
+@@ -3188,6 +3190,7 @@ typedef struct AVSubtitleRect {
+ * struct.
+ */
+ char *ass;
++ int flags;
+ } AVSubtitleRect;
+
+ typedef struct AVSubtitle {
+diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
+index 9fd26d8..0326ea8 100644
+--- a/libavcodec/pgssubdec.c
++++ b/libavcodec/pgssubdec.c
+@@ -45,6 +45,7 @@ typedef struct PGSSubPresentation {
+ int y;
+ int id_number;
+ int object_number;
++ uint8_t composition_flag;
+ } PGSSubPresentation;
+
+ typedef struct PGSSubPicture {
+@@ -299,16 +300,17 @@ static void parse_presentation_segment(AVCodecContext *avctx,
+ buf += 3;
+
+ ctx->presentation.object_number = bytestream_get_byte(&buf);
++ ctx->presentation.composition_flag = 0;
+ if (!ctx->presentation.object_number)
+ return;
+
+ /*
+- * Skip 4 bytes of unknown:
++ * Skip 3 bytes of unknown:
+ * object_id_ref (2 bytes),
+ * window_id_ref,
+- * composition_flag (0x80 - object cropped, 0x40 - object forced)
+ */
+- buf += 4;
++ buf += 3;
++ ctx->presentation.composition_flag = bytestream_get_byte(&buf);
+
+ x = bytestream_get_be16(&buf);
+ y = bytestream_get_be16(&buf);
+@@ -368,6 +370,9 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
+ sub->rects[0] = av_mallocz(sizeof(*sub->rects[0]));
+ sub->num_rects = 1;
+
++ if (ctx->presentation.composition_flag & 0x40)
++ sub->rects[0]->flags |= AV_SUBTITLE_FLAG_FORCED;
++
+ sub->rects[0]->x = ctx->presentation.x;
+ sub->rects[0]->y = ctx->presentation.y;
+ sub->rects[0]->w = ctx->picture.w;
+diff --git a/libavcodec/version.h b/libavcodec/version.h
+index 5ee7c7c..45ff507 100644
+--- a/libavcodec/version.h
++++ b/libavcodec/version.h
+@@ -27,7 +27,7 @@
+ */
+
+ #define LIBAVCODEC_VERSION_MAJOR 54
+-#define LIBAVCODEC_VERSION_MINOR 32
++#define LIBAVCODEC_VERSION_MINOR 33
+ #define LIBAVCODEC_VERSION_MICRO 0
+
+ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0163-parser-Move-Doxygen-documentation-to-the-header-file.patch b/debian/patches/post-9beta2/0163-parser-Move-Doxygen-documentation-to-the-header-file.patch
new file mode 100644
index 0000000..116a6d5
--- /dev/null
+++ b/debian/patches/post-9beta2/0163-parser-Move-Doxygen-documentation-to-the-header-file.patch
@@ -0,0 +1,73 @@
+From 9a07c1332cfe092b57b5758f22b686ca58806c60 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Fri, 2 Nov 2012 12:04:16 +0100
+Subject: [PATCH 163/204] parser: Move Doxygen documentation to the header
+ files
+
+---
+ libavcodec/avcodec.h | 4 ++++
+ libavcodec/parser.c | 9 ---------
+ libavcodec/parser.h | 5 +++++
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
+index 43f7c87..d5968f9 100644
+--- a/libavcodec/avcodec.h
++++ b/libavcodec/avcodec.h
+@@ -3890,6 +3890,10 @@ int av_parser_parse2(AVCodecParserContext *s,
+ int64_t pts, int64_t dts,
+ int64_t pos);
+
++/**
++ * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
++ * @deprecated use AVBitstreamFilter
++ */
+ int av_parser_change(AVCodecParserContext *s,
+ AVCodecContext *avctx,
+ uint8_t **poutbuf, int *poutbuf_size,
+diff --git a/libavcodec/parser.c b/libavcodec/parser.c
+index 03f327e..7ace766 100644
+--- a/libavcodec/parser.c
++++ b/libavcodec/parser.c
+@@ -167,11 +167,6 @@ int av_parser_parse2(AVCodecParserContext *s,
+ return index;
+ }
+
+-/**
+- *
+- * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
+- * @deprecated use AVBitstreamFilter
+- */
+ int av_parser_change(AVCodecParserContext *s,
+ AVCodecContext *avctx,
+ uint8_t **poutbuf, int *poutbuf_size,
+@@ -217,10 +212,6 @@ void av_parser_close(AVCodecParserContext *s)
+
+ /*****************************************************/
+
+-/**
+- * Combine the (truncated) bitstream to a complete frame.
+- * @return -1 if no complete frame could be created, AVERROR(ENOMEM) if there was a memory allocation error
+- */
+ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
+ {
+ if(pc->overread){
+diff --git a/libavcodec/parser.h b/libavcodec/parser.h
+index 1d029e3..ea1cae2 100644
+--- a/libavcodec/parser.h
++++ b/libavcodec/parser.h
+@@ -39,6 +39,11 @@ typedef struct ParseContext{
+
+ #define END_NOT_FOUND (-100)
+
++/**
++ * Combine the (truncated) bitstream to a complete frame.
++ * @return -1 if no complete frame could be created,
++ * AVERROR(ENOMEM) if there was a memory allocation error
++ */
+ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size);
+ int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf,
+ int buf_size);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0164-x86-Refactor-PSWAPD-fallback-implementations-and-por.patch b/debian/patches/post-9beta2/0164-x86-Refactor-PSWAPD-fallback-implementations-and-por.patch
new file mode 100644
index 0000000..0b51b79
--- /dev/null
+++ b/debian/patches/post-9beta2/0164-x86-Refactor-PSWAPD-fallback-implementations-and-por.patch
@@ -0,0 +1,120 @@
+From 0a7a94f2e53bcdb8ac5857eb8c67c16f6f1d0f2f Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Thu, 2 Aug 2012 00:55:34 +0200
+Subject: [PATCH 164/204] x86: Refactor PSWAPD fallback implementations and
+ port to cpuflags
+
+---
+ libavcodec/x86/fft.asm | 16 ++--------------
+ libavcodec/x86/fmtconvert.asm | 17 ++---------------
+ libavutil/x86/x86util.asm | 12 ++++++++++++
+ 3 files changed, 16 insertions(+), 29 deletions(-)
+
+diff --git a/libavcodec/x86/fft.asm b/libavcodec/x86/fft.asm
+index 8c69f1f..111f322 100644
+--- a/libavcodec/x86/fft.asm
++++ b/libavcodec/x86/fft.asm
+@@ -105,7 +105,8 @@ SECTION_TEXT
+ pfadd %5, %4 ; {t6,t5}
+ pxor %3, [ps_m1p1] ; {t8,t7}
+ mova %6, %1
+- PSWAPD %3, %3
++ movd [r0+12], %3
++ punpckhdq %3, [r0+8]
+ pfadd %1, %5 ; {r0,i0}
+ pfsub %6, %5 ; {r2,i2}
+ mova %4, %2
+@@ -498,19 +499,6 @@ fft8 %+ SUFFIX:
+ %endmacro
+
+ %if ARCH_X86_32
+-%macro PSWAPD 2
+-%if cpuflag(3dnowext)
+- pswapd %1, %2
+-%elifidn %1, %2
+- movd [r0+12], %1
+- punpckhdq %1, [r0+8]
+-%else
+- movq %1, %2
+- psrlq %1, 32
+- punpckldq %1, %2
+-%endif
+-%endmacro
+-
+ INIT_MMX 3dnowext
+ FFT48_3DNOW
+
+diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm
+index fb183ce..77b8bd7 100644
+--- a/libavcodec/x86/fmtconvert.asm
++++ b/libavcodec/x86/fmtconvert.asm
+@@ -246,16 +246,6 @@ FLOAT_TO_INT16_INTERLEAVE2
+ INIT_XMM sse2
+ FLOAT_TO_INT16_INTERLEAVE2
+
+-
+-%macro PSWAPD_SSE 2
+- pshufw %1, %2, 0x4e
+-%endmacro
+-%macro PSWAPD_3DNOW 2
+- movq %1, %2
+- psrlq %1, 32
+- punpckldq %1, %2
+-%endmacro
+-
+ %macro FLOAT_TO_INT16_INTERLEAVE6 0
+ ; void float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len)
+ cglobal float_to_int16_interleave6, 2, 8, 0, dst, src, src1, src2, src3, src4, src5, len
+@@ -285,11 +275,11 @@ cglobal float_to_int16_interleave6, 2, 8, 0, dst, src, src1, src2, src3, src4, s
+ packssdw mm0, mm3
+ packssdw mm1, mm4
+ packssdw mm2, mm5
+- pswapd mm3, mm0
++ PSWAPD mm3, mm0
+ punpcklwd mm0, mm1
+ punpckhwd mm1, mm2
+ punpcklwd mm2, mm3
+- pswapd mm3, mm0
++ PSWAPD mm3, mm0
+ punpckldq mm0, mm2
+ punpckhdq mm2, mm1
+ punpckldq mm1, mm3
+@@ -305,12 +295,9 @@ cglobal float_to_int16_interleave6, 2, 8, 0, dst, src, src1, src2, src3, src4, s
+ %endmacro ; FLOAT_TO_INT16_INTERLEAVE6
+
+ INIT_MMX sse
+-%define pswapd PSWAPD_SSE
+ FLOAT_TO_INT16_INTERLEAVE6
+ INIT_MMX 3dnow
+-%define pswapd PSWAPD_3DNOW
+ FLOAT_TO_INT16_INTERLEAVE6
+-%undef pswapd
+ INIT_MMX 3dnowext
+ FLOAT_TO_INT16_INTERLEAVE6
+
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index ca0041a..9183d38 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -319,6 +319,18 @@
+ %endif
+ %endmacro
+
++%macro PSWAPD 2
++%if cpuflag(mmxext)
++ pshufw %1, %2, q1032
++%elif cpuflag(3dnowext)
++ pswapd %1, %2
++%elif cpuflag(3dnow)
++ movq %1, %2
++ psrlq %1, 32
++ punpckldq %1, %2
++%endif
++%endmacro
++
+ %macro DEINTB 5 ; mask, reg1, mask, reg2, optional src to fill masks from
+ %ifnum %5
+ pand m%3, m%5, m%4 ; src .. y6 .. y4
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0165-vf_drawtext-do-not-use-deprecated-av_tree_node_size.patch b/debian/patches/post-9beta2/0165-vf_drawtext-do-not-use-deprecated-av_tree_node_size.patch
new file mode 100644
index 0000000..845a8c1
--- /dev/null
+++ b/debian/patches/post-9beta2/0165-vf_drawtext-do-not-use-deprecated-av_tree_node_size.patch
@@ -0,0 +1,25 @@
+From b68aac7ea34ec92321508f7365b5f2813766be79 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Fri, 2 Nov 2012 10:56:30 +0100
+Subject: [PATCH 165/204] vf_drawtext: do not use deprecated av_tree_node_size
+
+---
+ libavfilter/vf_drawtext.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
+index ecc789c..43a42d8 100644
+--- a/libavfilter/vf_drawtext.c
++++ b/libavfilter/vf_drawtext.c
+@@ -263,7 +263,7 @@ static int load_glyph(AVFilterContext *ctx, Glyph **glyph_ptr, uint32_t code)
+ FT_Glyph_Get_CBox(*glyph->glyph, ft_glyph_bbox_pixels, &glyph->bbox);
+
+ /* cache the newly created glyph */
+- if (!(node = av_mallocz(av_tree_node_size))) {
++ if (!(node = av_tree_node_alloc())) {
+ ret = AVERROR(ENOMEM);
+ goto error;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0166-crc-move-doxy-to-the-header.patch b/debian/patches/post-9beta2/0166-crc-move-doxy-to-the-header.patch
new file mode 100644
index 0000000..2f9c6e4
--- /dev/null
+++ b/debian/patches/post-9beta2/0166-crc-move-doxy-to-the-header.patch
@@ -0,0 +1,109 @@
+From b4dc6dccbaea08fc0d41e99b020ee1e0e9ff301b Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Fri, 2 Nov 2012 10:58:36 +0100
+Subject: [PATCH 166/204] crc: move doxy to the header
+
+---
+ libavutil/crc.c | 28 ----------------------------
+ libavutil/crc.h | 30 ++++++++++++++++++++++++++++++
+ 2 files changed, 30 insertions(+), 28 deletions(-)
+
+diff --git a/libavutil/crc.c b/libavutil/crc.c
+index ee925d6..47520e5 100644
+--- a/libavutil/crc.c
++++ b/libavutil/crc.c
+@@ -40,22 +40,6 @@ static struct {
+ static AVCRC av_crc_table[AV_CRC_MAX][257];
+ #endif
+
+-/**
+- * Initialize a CRC table.
+- * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
+- * @param le If 1, the lowest bit represents the coefficient for the highest
+- * exponent of the corresponding polynomial (both for poly and
+- * actual CRC).
+- * If 0, you must swap the CRC parameter and the result of av_crc
+- * if you need the standard representation (can be simplified in
+- * most cases to e.g. bswap16):
+- * av_bswap32(crc << (32-bits))
+- * @param bits number of bits for the CRC
+- * @param poly generator polynomial without the x**bits coefficient, in the
+- * representation as specified by le
+- * @param ctx_size size of ctx in bytes
+- * @return <0 on failure
+- */
+ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
+ {
+ unsigned i, j;
+@@ -89,11 +73,6 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
+ return 0;
+ }
+
+-/**
+- * Get an initialized standard CRC table.
+- * @param crc_id ID of a standard CRC
+- * @return a pointer to the CRC table or NULL on failure
+- */
+ const AVCRC *av_crc_get_table(AVCRCId crc_id)
+ {
+ #if !CONFIG_HARDCODED_TABLES
+@@ -108,13 +87,6 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id)
+ return av_crc_table[crc_id];
+ }
+
+-/**
+- * Calculate the CRC of a block.
+- * @param crc CRC of previous blocks if any or initial value for CRC
+- * @return CRC updated with the data from the given block
+- *
+- * @see av_crc_init() "le" parameter
+- */
+ uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
+ const uint8_t *buffer, size_t length)
+ {
+diff --git a/libavutil/crc.h b/libavutil/crc.h
+index 5c25607..142a5b5 100644
+--- a/libavutil/crc.h
++++ b/libavutil/crc.h
+@@ -36,8 +36,38 @@ typedef enum {
+ AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
+ }AVCRCId;
+
++/**
++ * Initialize a CRC table.
++ * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
++ * @param le If 1, the lowest bit represents the coefficient for the highest
++ * exponent of the corresponding polynomial (both for poly and
++ * actual CRC).
++ * If 0, you must swap the CRC parameter and the result of av_crc
++ * if you need the standard representation (can be simplified in
++ * most cases to e.g. bswap16):
++ * av_bswap32(crc << (32-bits))
++ * @param bits number of bits for the CRC
++ * @param poly generator polynomial without the x**bits coefficient, in the
++ * representation as specified by le
++ * @param ctx_size size of ctx in bytes
++ * @return <0 on failure
++ */
+ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
++
++/**
++ * Get an initialized standard CRC table.
++ * @param crc_id ID of a standard CRC
++ * @return a pointer to the CRC table or NULL on failure
++ */
+ const AVCRC *av_crc_get_table(AVCRCId crc_id);
++
++/**
++ * Calculate the CRC of a block.
++ * @param crc CRC of previous blocks if any or initial value for CRC
++ * @return CRC updated with the data from the given block
++ *
++ * @see av_crc_init() "le" parameter
++ */
+ uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure;
+
+ #endif /* AVUTIL_CRC_H */
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0167-avconv-do-not-free-muxed-packet-on-streamcopy.patch b/debian/patches/post-9beta2/0167-avconv-do-not-free-muxed-packet-on-streamcopy.patch
new file mode 100644
index 0000000..ec89750
--- /dev/null
+++ b/debian/patches/post-9beta2/0167-avconv-do-not-free-muxed-packet-on-streamcopy.patch
@@ -0,0 +1,27 @@
+From c8977f6d268462e237cee38be6159c7bb701c62e Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 31 Oct 2012 21:15:41 +0100
+Subject: [PATCH 167/204] avconv: do not free muxed packet on streamcopy.
+
+The packet belongs to lavf, the caller must not free it or access it in
+any other way.
+No change in practice, since destruct is set to NULL anyway.
+---
+ avconv.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/avconv.c b/avconv.c
+index d0902a6..964847a 100644
+--- a/avconv.c
++++ b/avconv.c
+@@ -1045,7 +1045,6 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
+
+ write_frame(of->ctx, &opkt, ost);
+ ost->st->codec->frame_number++;
+- av_free_packet(&opkt);
+ }
+
+ static void rate_emu_sleep(InputStream *ist)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0168-lavf-clarify-the-lifetime-of-demuxed-packets.patch b/debian/patches/post-9beta2/0168-lavf-clarify-the-lifetime-of-demuxed-packets.patch
new file mode 100644
index 0000000..48aaf84
--- /dev/null
+++ b/debian/patches/post-9beta2/0168-lavf-clarify-the-lifetime-of-demuxed-packets.patch
@@ -0,0 +1,56 @@
+From 717a4509930854081deea54a3bfcdb547161fecf Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 31 Oct 2012 19:59:53 +0100
+Subject: [PATCH 168/204] lavf: clarify the lifetime of demuxed packets.
+
+---
+ libavformat/avformat.h | 26 ++++++++++++++++----------
+ 1 file changed, 16 insertions(+), 10 deletions(-)
+
+diff --git a/libavformat/avformat.h b/libavformat/avformat.h
+index 8af007e..0961308 100644
+--- a/libavformat/avformat.h
++++ b/libavformat/avformat.h
+@@ -158,9 +158,15 @@
+ * information will be in AVStream.time_base units, i.e. it has to be
+ * multiplied by the timebase to convert them to seconds.
+ *
+- * The packet data belongs to the demuxer and is invalid after the next call to
+- * av_read_frame(). The user must free the packet with av_free_packet() before
+- * calling av_read_frame() again or closing the file.
++ * If AVPacket.destruct is set on the returned packet, then the packet is
++ * allocated dynamically and the user may keep it indefinitely.
++ * Otherwise, if AVPacket.destruct is NULL, the packet data is backed by a
++ * static storage somewhere inside the demuxer and the packet is only valid
++ * until the next av_read_frame() call or closing the file. If the caller
++ * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy
++ * of it.
++ * In both cases, the packet must be freed with av_free_packet() when it is no
++ * longer needed.
+ *
+ * @section lavf_decoding_seek Seeking
+ * @}
+@@ -1307,13 +1313,13 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt);
+ * omit invalid data between valid frames so as to give the decoder the maximum
+ * information possible for decoding.
+ *
+- * The returned packet is valid
+- * until the next av_read_frame() or until av_close_input_file() and
+- * must be freed with av_free_packet. For video, the packet contains
+- * exactly one frame. For audio, it contains an integer number of
+- * 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.
++ * If pkt->destruct is NULL, then the packet is valid until the next
++ * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid
++ * indefinitely. In both cases the packet must be freed with
++ * av_free_packet when it is no longer needed. For video, the packet contains
++ * exactly one frame. For audio, it contains an integer number of 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 AVStream.time_base units (and guessed if the format cannot
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0169-lavf-fix-av_interleaved_write_frame-doxy.patch b/debian/patches/post-9beta2/0169-lavf-fix-av_interleaved_write_frame-doxy.patch
new file mode 100644
index 0000000..cdb2c83
--- /dev/null
+++ b/debian/patches/post-9beta2/0169-lavf-fix-av_interleaved_write_frame-doxy.patch
@@ -0,0 +1,30 @@
+From 9221efef7968463f3e3d9ce79ea72eaca082e73f Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Wed, 31 Oct 2012 16:54:16 +0100
+Subject: [PATCH 169/204] lavf: fix av_interleaved_write_frame() doxy.
+
+A sentence was mistakenly inserted in the middle of another sentence.
+---
+ libavformat/avformat.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavformat/avformat.h b/libavformat/avformat.h
+index 0961308..3e10496 100644
+--- a/libavformat/avformat.h
++++ b/libavformat/avformat.h
+@@ -1463,10 +1463,10 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
+ * @param s media file handle
+ * @param pkt The packet containing the data to be written. Libavformat takes
+ * ownership of the data and will free it when it sees fit using the packet's
+- * This can be NULL (at any time, not just at the end), to flush the
+- * interleaving queues.
+ * @ref AVPacket.destruct "destruct" field. The caller must not access the data
+ * after this function returns, as it may already be freed.
++ * This can be NULL (at any time, not just at the end), to flush the
++ * interleaving queues.
+ * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the
+ * index of the corresponding stream in @ref AVFormatContext.streams
+ * "s.streams".
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0170-matroskadec-do-not-use-avpacket-internals.patch b/debian/patches/post-9beta2/0170-matroskadec-do-not-use-avpacket-internals.patch
new file mode 100644
index 0000000..948ec2e
--- /dev/null
+++ b/debian/patches/post-9beta2/0170-matroskadec-do-not-use-avpacket-internals.patch
@@ -0,0 +1,38 @@
+From 34871beb5eb6bc59f5e58326a214efd88a4c2ccd Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Thu, 1 Nov 2012 06:34:41 +0100
+Subject: [PATCH 170/204] matroskadec: do not use avpacket internals
+
+---
+ libavformat/matroskadec.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
+index 26f8707..bf67253 100644
+--- a/libavformat/matroskadec.c
++++ b/libavformat/matroskadec.c
+@@ -1137,13 +1137,14 @@ static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska,
+
+ static int matroska_merge_packets(AVPacket *out, AVPacket *in)
+ {
+- void *newdata = av_realloc(out->data, out->size+in->size);
+- if (!newdata)
+- return AVERROR(ENOMEM);
+- out->data = newdata;
+- memcpy(out->data+out->size, in->data, in->size);
+- out->size += in->size;
+- av_destruct_packet(in);
++ int old_size = out->size;
++ int ret = av_grow_packet(out, in->size);
++ if (ret < 0)
++ return ret;
++
++ memcpy(out->data + old_size, in->data, in->size);
++
++ av_free_packet(in);
+ av_free(in);
+ return 0;
+ }
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0171-doc-add-apidoc-target-for-doxygen-API-documentation.patch b/debian/patches/post-9beta2/0171-doc-add-apidoc-target-for-doxygen-API-documentation.patch
new file mode 100644
index 0000000..5aa5425
--- /dev/null
+++ b/debian/patches/post-9beta2/0171-doc-add-apidoc-target-for-doxygen-API-documentation.patch
@@ -0,0 +1,88 @@
+From b3fab1f2cd22bfaee95831af57a65f803f03083c Mon Sep 17 00:00:00 2001
+From: Janne Grunau <janne-libav at jannau.net>
+Date: Mon, 29 Oct 2012 16:26:59 +0100
+Subject: [PATCH 171/204] doc: add apidoc target for doxygen API documentation
+
+Documentation includes only the externally visible API of the installed
+headers.
+
+Based on a patch by Anton Khirnov <anton at khirnov.net>.
+
+Signed-off-by: Anton Khirnov <anton at khirnov.net>
+---
+ doc/Makefile | 9 +++++++--
+ doc/doxy-wrapper.sh | 14 ++++++++++++++
+ library.mak | 2 ++
+ 3 files changed, 23 insertions(+), 2 deletions(-)
+ create mode 100755 doc/doxy-wrapper.sh
+
+diff --git a/doc/Makefile b/doc/Makefile
+index 6353034..d22de79 100644
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -14,6 +14,7 @@ DOCS = $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
+
+ all-$(CONFIG_DOC): documentation
+
++apidoc: doc/doxy/html
+ documentation: $(DOCS)
+
+ TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
+@@ -39,7 +40,10 @@ doc/%.1: TAG = MAN
+ doc/%.1: doc/%.pod $(GENTEXI)
+ $(M)pod2man --section=1 --center=" " --release=" " $< > $@
+
+-$(DOCS): | doc/
++$(DOCS) doc/doxy/html: | doc/
++
++doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
++ $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
+
+ install-progs-$(CONFIG_DOC): install-man
+
+@@ -54,7 +58,8 @@ uninstall-man:
+
+ clean::
+ $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
++ $(RM) -r doc/doxy/html
+
+ -include $(wildcard $(DOCS:%=%.d))
+
+-.PHONY: documentation
++.PHONY: apidoc documentation
+diff --git a/doc/doxy-wrapper.sh b/doc/doxy-wrapper.sh
+new file mode 100755
+index 0000000..6650e38
+--- /dev/null
++++ b/doc/doxy-wrapper.sh
+@@ -0,0 +1,14 @@
++#!/bin/sh
++
++SRC_PATH="${1}"
++DOXYFILE="${2}"
++
++shift 2
++
++doxygen - <<EOF
++ at INCLUDE = ${DOXYFILE}
++INPUT = $@
++HTML_HEADER = ${SRC_PATH}/doc/doxy/header.html
++HTML_FOOTER = ${SRC_PATH}/doc/doxy/footer.html
++HTML_STYLESHEET = ${SRC_PATH}/doc/doxy/doxy_stylesheet.css
++EOF
+diff --git a/library.mak b/library.mak
+index cbfa0d4..33ec37f 100644
+--- a/library.mak
++++ b/library.mak
+@@ -6,6 +6,8 @@ LIBVERSION := $(lib$(NAME)_VERSION)
+ LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
+ INCINSTDIR := $(INCDIR)/lib$(NAME)
+
++INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
++
+ all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
+ all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0172-rtmp-Use-av_strlcat-instead-of-strncat.patch b/debian/patches/post-9beta2/0172-rtmp-Use-av_strlcat-instead-of-strncat.patch
new file mode 100644
index 0000000..cad3451
--- /dev/null
+++ b/debian/patches/post-9beta2/0172-rtmp-Use-av_strlcat-instead-of-strncat.patch
@@ -0,0 +1,29 @@
+From d578f94746dd85dd066abb8bc6bd3c5825a4f759 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Mon, 5 Nov 2012 11:01:24 +0200
+Subject: [PATCH 172/204] rtmp: Use av_strlcat instead of strncat
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavformat/rtmpproto.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
+index 3ab2e57..8924fb3 100644
+--- a/libavformat/rtmpproto.c
++++ b/libavformat/rtmpproto.c
+@@ -2188,7 +2188,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
+ } else {
+ rt->playpath[0] = 0;
+ }
+- strncat(rt->playpath, fname, PLAYPATH_MAX_LENGTH - 5);
++ av_strlcat(rt->playpath, fname, PLAYPATH_MAX_LENGTH);
+ }
+
+ if (!rt->tcurl) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0173-x86-vc1dsp-port-to-cpuflags.patch b/debian/patches/post-9beta2/0173-x86-vc1dsp-port-to-cpuflags.patch
new file mode 100644
index 0000000..cf94f33
--- /dev/null
+++ b/debian/patches/post-9beta2/0173-x86-vc1dsp-port-to-cpuflags.patch
@@ -0,0 +1,211 @@
+From 6c104826bd6e46ff5a02a3f1dcbd6e0b6bf8743a Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 15 Jul 2012 18:49:44 +0200
+Subject: [PATCH 173/204] x86: vc1dsp: port to cpuflags
+
+---
+ libavcodec/x86/vc1dsp.asm | 83 +++++++++++++++++++++---------------------
+ libavcodec/x86/vc1dsp_init.c | 4 +-
+ 2 files changed, 44 insertions(+), 43 deletions(-)
+
+diff --git a/libavcodec/x86/vc1dsp.asm b/libavcodec/x86/vc1dsp.asm
+index ab15f7b..4b56c31 100644
+--- a/libavcodec/x86/vc1dsp.asm
++++ b/libavcodec/x86/vc1dsp.asm
+@@ -34,7 +34,13 @@ section .text
+ punpckl%1 m%2, m%4
+ %endmacro
+
+-%macro STORE_4_WORDS_MMX 6
++%macro STORE_4_WORDS 6
++%if cpuflag(sse4)
++ pextrw %1, %5, %6+0
++ pextrw %2, %5, %6+1
++ pextrw %3, %5, %6+2
++ pextrw %4, %5, %6+3
++%else
+ movd %6d, %5
+ %if mmsize==16
+ psrldq %5, 4
+@@ -48,13 +54,7 @@ section .text
+ mov %3, %6w
+ shr %6, 16
+ mov %4, %6w
+-%endmacro
+-
+-%macro STORE_4_WORDS_SSE4 6
+- pextrw %1, %5, %6+0
+- pextrw %2, %5, %6+1
+- pextrw %3, %5, %6+2
+- pextrw %4, %5, %6+3
++%endif
+ %endmacro
+
+ ; in: p1 p0 q0 q1, clobbers p0
+@@ -200,14 +200,14 @@ section .text
+ VC1_FILTER %1
+ punpcklbw m0, m1
+ %if %0 > 1
+- STORE_4_WORDS_MMX [r0-1], [r0+r1-1], [r0+2*r1-1], [r0+r3-1], m0, %2
++ STORE_4_WORDS [r0-1], [r0+r1-1], [r0+2*r1-1], [r0+r3-1], m0, %2
+ %if %1 > 4
+ psrldq m0, 4
+- STORE_4_WORDS_MMX [r4-1], [r4+r1-1], [r4+2*r1-1], [r4+r3-1], m0, %2
++ STORE_4_WORDS [r4-1], [r4+r1-1], [r4+2*r1-1], [r4+r3-1], m0, %2
+ %endif
+ %else
+- STORE_4_WORDS_SSE4 [r0-1], [r0+r1-1], [r0+2*r1-1], [r0+r3-1], m0, 0
+- STORE_4_WORDS_SSE4 [r4-1], [r4+r1-1], [r4+2*r1-1], [r4+r3-1], m0, 4
++ STORE_4_WORDS [r0-1], [r0+r1-1], [r0+2*r1-1], [r0+r3-1], m0, 0
++ STORE_4_WORDS [r4-1], [r4+r1-1], [r4+2*r1-1], [r4+r3-1], m0, 4
+ %endif
+ %endmacro
+
+@@ -228,92 +228,93 @@ section .text
+ imul r2, 0x01010101
+ %endmacro
+
+-%macro VC1_LF_MMX 1
+-INIT_MMX
+-cglobal vc1_v_loop_filter_internal_%1
++%macro VC1_LF 0
++cglobal vc1_v_loop_filter_internal
+ VC1_V_LOOP_FILTER 4, d
+ ret
+
+-cglobal vc1_h_loop_filter_internal_%1
++cglobal vc1_h_loop_filter_internal
+ VC1_H_LOOP_FILTER 4, r4
+ ret
+
+-; void ff_vc1_v_loop_filter4_mmx2(uint8_t *src, int stride, int pq)
+-cglobal vc1_v_loop_filter4_%1, 3,5,0
++; void ff_vc1_v_loop_filter4_mmxext(uint8_t *src, int stride, int pq)
++cglobal vc1_v_loop_filter4, 3,5,0
+ START_V_FILTER
+- call vc1_v_loop_filter_internal_%1
++ call vc1_v_loop_filter_internal
+ RET
+
+-; void ff_vc1_h_loop_filter4_mmx2(uint8_t *src, int stride, int pq)
+-cglobal vc1_h_loop_filter4_%1, 3,5,0
++; void ff_vc1_h_loop_filter4_mmxext(uint8_t *src, int stride, int pq)
++cglobal vc1_h_loop_filter4, 3,5,0
+ START_H_FILTER 4
+- call vc1_h_loop_filter_internal_%1
++ call vc1_h_loop_filter_internal
+ RET
+
+-; void ff_vc1_v_loop_filter8_mmx2(uint8_t *src, int stride, int pq)
+-cglobal vc1_v_loop_filter8_%1, 3,5,0
++; void ff_vc1_v_loop_filter8_mmxext(uint8_t *src, int stride, int pq)
++cglobal vc1_v_loop_filter8, 3,5,0
+ START_V_FILTER
+- call vc1_v_loop_filter_internal_%1
++ call vc1_v_loop_filter_internal
+ add r4, 4
+ add r0, 4
+- call vc1_v_loop_filter_internal_%1
++ call vc1_v_loop_filter_internal
+ RET
+
+-; void ff_vc1_h_loop_filter8_mmx2(uint8_t *src, int stride, int pq)
+-cglobal vc1_h_loop_filter8_%1, 3,5,0
++; void ff_vc1_h_loop_filter8_mmxext(uint8_t *src, int stride, int pq)
++cglobal vc1_h_loop_filter8, 3,5,0
+ START_H_FILTER 4
+- call vc1_h_loop_filter_internal_%1
++ call vc1_h_loop_filter_internal
+ lea r0, [r0+4*r1]
+- call vc1_h_loop_filter_internal_%1
++ call vc1_h_loop_filter_internal
+ RET
+ %endmacro
+
++INIT_MMX mmxext
+ %define PABSW PABSW_MMXEXT
+-VC1_LF_MMX mmx2
++VC1_LF
+
+-INIT_XMM
++INIT_XMM sse2
+ ; void ff_vc1_v_loop_filter8_sse2(uint8_t *src, int stride, int pq)
+-cglobal vc1_v_loop_filter8_sse2, 3,5,8
++cglobal vc1_v_loop_filter8, 3,5,8
+ START_V_FILTER
+ VC1_V_LOOP_FILTER 8, q
+ RET
+
+ ; void ff_vc1_h_loop_filter8_sse2(uint8_t *src, int stride, int pq)
+-cglobal vc1_h_loop_filter8_sse2, 3,6,8
++cglobal vc1_h_loop_filter8, 3,6,8
+ START_H_FILTER 8
+ VC1_H_LOOP_FILTER 8, r5
+ RET
+
+ %define PABSW PABSW_SSSE3
+
+-INIT_MMX
++INIT_MMX ssse3
+ ; void ff_vc1_v_loop_filter4_ssse3(uint8_t *src, int stride, int pq)
+-cglobal vc1_v_loop_filter4_ssse3, 3,5,0
++cglobal vc1_v_loop_filter4, 3,5,0
+ START_V_FILTER
+ VC1_V_LOOP_FILTER 4, d
+ RET
+
+ ; void ff_vc1_h_loop_filter4_ssse3(uint8_t *src, int stride, int pq)
+-cglobal vc1_h_loop_filter4_ssse3, 3,5,0
++cglobal vc1_h_loop_filter4, 3,5,0
+ START_H_FILTER 4
+ VC1_H_LOOP_FILTER 4, r4
+ RET
+
+-INIT_XMM
++INIT_XMM ssse3
+ ; void ff_vc1_v_loop_filter8_ssse3(uint8_t *src, int stride, int pq)
+-cglobal vc1_v_loop_filter8_ssse3, 3,5,8
++cglobal vc1_v_loop_filter8, 3,5,8
+ START_V_FILTER
+ VC1_V_LOOP_FILTER 8, q
+ RET
+
+ ; void ff_vc1_h_loop_filter8_ssse3(uint8_t *src, int stride, int pq)
+-cglobal vc1_h_loop_filter8_ssse3, 3,6,8
++cglobal vc1_h_loop_filter8, 3,6,8
+ START_H_FILTER 8
+ VC1_H_LOOP_FILTER 8, r5
+ RET
+
++INIT_XMM sse4
+ ; void ff_vc1_h_loop_filter8_sse4(uint8_t *src, int stride, int pq)
+-cglobal vc1_h_loop_filter8_sse4, 3,5,8
++cglobal vc1_h_loop_filter8, 3,5,8
+ START_H_FILTER 8
+ VC1_H_LOOP_FILTER 8
+ RET
+diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
+index 6d868e8..c359c4a 100644
+--- a/libavcodec/x86/vc1dsp_init.c
++++ b/libavcodec/x86/vc1dsp_init.c
+@@ -49,7 +49,7 @@ static void vc1_h_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \
+ }
+
+ #if HAVE_YASM
+-LOOP_FILTER(mmx2)
++LOOP_FILTER(mmxext)
+ LOOP_FILTER(sse2)
+ LOOP_FILTER(ssse3)
+
+@@ -98,7 +98,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
+ }
+
+ if (mm_flags & AV_CPU_FLAG_MMXEXT) {
+- ASSIGN_LF(mmx2);
++ ASSIGN_LF(mmxext);
+ dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_mmx2;
+ } else if (mm_flags & AV_CPU_FLAG_3DNOW) {
+ dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_3dnow;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0174-x86-PABSW-port-to-cpuflags.patch b/debian/patches/post-9beta2/0174-x86-PABSW-port-to-cpuflags.patch
new file mode 100644
index 0000000..4b0f5e3
--- /dev/null
+++ b/debian/patches/post-9beta2/0174-x86-PABSW-port-to-cpuflags.patch
@@ -0,0 +1,79 @@
+From dbb37e77117466edfc146f9f0df4c70bef6239d6 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 15 Jul 2012 17:59:26 +0200
+Subject: [PATCH 174/204] x86: PABSW: port to cpuflags
+
+---
+ libavcodec/x86/vc1dsp.asm | 3 ---
+ libavutil/x86/x86util.asm | 22 ++++++++++------------
+ 2 files changed, 10 insertions(+), 15 deletions(-)
+
+diff --git a/libavcodec/x86/vc1dsp.asm b/libavcodec/x86/vc1dsp.asm
+index 4b56c31..adf08d7 100644
+--- a/libavcodec/x86/vc1dsp.asm
++++ b/libavcodec/x86/vc1dsp.asm
+@@ -268,7 +268,6 @@ cglobal vc1_h_loop_filter8, 3,5,0
+ %endmacro
+
+ INIT_MMX mmxext
+-%define PABSW PABSW_MMXEXT
+ VC1_LF
+
+ INIT_XMM sse2
+@@ -284,8 +283,6 @@ cglobal vc1_h_loop_filter8, 3,6,8
+ VC1_H_LOOP_FILTER 8, r5
+ RET
+
+-%define PABSW PABSW_SSSE3
+-
+ INIT_MMX ssse3
+ ; void ff_vc1_v_loop_filter4_ssse3(uint8_t *src, int stride, int pq)
+ cglobal vc1_v_loop_filter4, 3,5,0
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index 9183d38..b35d594 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -145,13 +145,21 @@
+ %endif
+ %endmacro
+
+-; PABSW macros assume %1 != %2, while ABS1/2 macros work in-place
+-%macro PABSW_MMX 2
++; PABSW macro assumes %1 != %2, while ABS1/2 macros work in-place
++%macro PABSW 2
++%if cpuflag(ssse3)
++ pabsw %1, %2
++%elif cpuflag(mmxext)
++ pxor %1, %1
++ psubw %1, %2
++ pmaxsw %1, %2
++%else
+ pxor %1, %1
+ pcmpgtw %1, %2
+ pxor %2, %1
+ psubw %2, %1
+ SWAP %1, %2
++%endif
+ %endmacro
+
+ %macro PSIGNW_MMX 2
+@@ -159,16 +167,6 @@
+ psubw %1, %2
+ %endmacro
+
+-%macro PABSW_MMXEXT 2
+- pxor %1, %1
+- psubw %1, %2
+- pmaxsw %1, %2
+-%endmacro
+-
+-%macro PABSW_SSSE3 2
+- pabsw %1, %2
+-%endmacro
+-
+ %macro PSIGNW_SSSE3 2
+ psignw %1, %2
+ %endmacro
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0175-x86-h264qpel-Only-define-mmxext-QPEL-functions-if-H2.patch b/debian/patches/post-9beta2/0175-x86-h264qpel-Only-define-mmxext-QPEL-functions-if-H2.patch
new file mode 100644
index 0000000..f651467
--- /dev/null
+++ b/debian/patches/post-9beta2/0175-x86-h264qpel-Only-define-mmxext-QPEL-functions-if-H2.patch
@@ -0,0 +1,26 @@
+From 930e26a3ea9d223e04bac4cdde13697cec770031 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Fri, 2 Nov 2012 18:25:08 +0100
+Subject: [PATCH 175/204] x86: h264qpel: Only define mmxext QPEL functions if
+ H264QPEL is enabled
+
+This fixes compilation with --disable-everything and components enabled.
+---
+ libavcodec/x86/h264_qpel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c
+index f978520..cf944c1 100644
+--- a/libavcodec/x86/h264_qpel.c
++++ b/libavcodec/x86/h264_qpel.c
+@@ -1286,6 +1286,6 @@ QPEL16_OP(mc31, MMX)\
+ QPEL16_OP(mc32, MMX)\
+ QPEL16_OP(mc33, MMX)
+
+-#if ARCH_X86_32 && HAVE_YASM // ARCH_X86_64 implies sse2+
++#if ARCH_X86_32 && HAVE_YASM && CONFIG_H264QPEL // ARCH_X86_64 implies SSE2+
+ QPEL16(mmxext)
+ #endif
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0176-build-The-A64-muxer-depends-on-rawenc.o-for-ff_raw_w.patch b/debian/patches/post-9beta2/0176-build-The-A64-muxer-depends-on-rawenc.o-for-ff_raw_w.patch
new file mode 100644
index 0000000..c7c94a3
--- /dev/null
+++ b/debian/patches/post-9beta2/0176-build-The-A64-muxer-depends-on-rawenc.o-for-ff_raw_w.patch
@@ -0,0 +1,26 @@
+From 92fec47d69d2c3187bea2f246984e03ec6ca3c3c Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Fri, 2 Nov 2012 22:49:04 +0100
+Subject: [PATCH 176/204] build: The A64 muxer depends on rawenc.o for
+ ff_raw_write_packet()
+
+---
+ libavformat/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavformat/Makefile b/libavformat/Makefile
+index acf0500..ed030bd 100644
+--- a/libavformat/Makefile
++++ b/libavformat/Makefile
+@@ -24,7 +24,7 @@ OBJS = allformats.o \
+ OBJS-$(CONFIG_NETWORK) += network.o
+
+ # muxers/demuxers
+-OBJS-$(CONFIG_A64_MUXER) += a64.o
++OBJS-$(CONFIG_A64_MUXER) += a64.o rawenc.o
+ OBJS-$(CONFIG_AAC_DEMUXER) += aacdec.o rawdec.o
+ OBJS-$(CONFIG_AC3_DEMUXER) += ac3dec.o rawdec.o
+ OBJS-$(CONFIG_AC3_MUXER) += rawenc.o
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0177-fate-aac-Place-LATM-tests-and-general-AAC-tests-in-d.patch b/debian/patches/post-9beta2/0177-fate-aac-Place-LATM-tests-and-general-AAC-tests-in-d.patch
new file mode 100644
index 0000000..a9d981f
--- /dev/null
+++ b/debian/patches/post-9beta2/0177-fate-aac-Place-LATM-tests-and-general-AAC-tests-in-d.patch
@@ -0,0 +1,52 @@
+From 2253df76c1913b5fcc71a9f4f254c78acd9be669 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sat, 20 Oct 2012 12:21:41 +0200
+Subject: [PATCH 177/204] fate: aac: Place LATM tests and general AAC tests in
+ different groups
+
+---
+ tests/fate/aac.mak | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak
+index 9d52dae..0368798 100644
+--- a/tests/fate/aac.mak
++++ b/tests/fate/aac.mak
+@@ -46,7 +46,7 @@ FATE_AAC += fate-aac-al_sbr_ps_06_ur
+ fate-aac-al_sbr_ps_06_ur: CMD = pcm -i $(SAMPLES)/aac/al_sbr_ps_06_new.mp4
+ fate-aac-al_sbr_ps_06_ur: REF = $(SAMPLES)/aac/al_sbr_ps_06_ur.s16
+
+-FATE_AAC += fate-aac-latm_000000001180bc60
++FATE_AAC_LATM += fate-aac-latm_000000001180bc60
+ fate-aac-latm_000000001180bc60: CMD = pcm -i $(SAMPLES)/aac/latm_000000001180bc60.mpg
+ fate-aac-latm_000000001180bc60: REF = $(SAMPLES)/aac/latm_000000001180bc60.s16
+
+@@ -54,7 +54,7 @@ FATE_AAC += fate-aac-ap05_48
+ fate-aac-ap05_48: CMD = pcm -i $(SAMPLES)/aac/ap05_48.mp4
+ fate-aac-ap05_48: REF = $(SAMPLES)/aac/ap05_48.s16
+
+-FATE_AAC += fate-aac-latm_stereo_to_51
++FATE_AAC_LATM += fate-aac-latm_stereo_to_51
+ fate-aac-latm_stereo_to_51: CMD = pcm -i $(SAMPLES)/aac/latm_stereo_to_51.ts -channel_layout 5.1
+ fate-aac-latm_stereo_to_51: REF = $(SAMPLES)/aac/latm_stereo_to_51_ref.s16
+
+@@ -71,7 +71,12 @@ FATE_AAC_CT = sbr_bc-ps_i.3gp \
+
+ FATE_AAC += $(FATE_AAC_CT:%=fate-aac-ct-%)
+
+-FATE_SAMPLES_AVCONV += $(FATE_AAC)
+-fate-aac: $(FATE_AAC)
+-$(FATE_AAC): CMP = oneoff
+-$(FATE_AAC): FUZZ = 2
++FATE_AAC_ALL = $(FATE_AAC) $(FATE_AAC_LATM)
++
++$(FATE_AAC_ALL): CMP = oneoff
++$(FATE_AAC_ALL): FUZZ = 2
++
++FATE_SAMPLES_AVCONV += $(FATE_AAC_ALL)
++
++fate-aac: $(FATE_AAC_ALL)
++fate-aac-latm: $(FATE_AAC_LATM)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0178-flacenc-use-a-separate-buffer-for-byte-swapping-for-.patch b/debian/patches/post-9beta2/0178-flacenc-use-a-separate-buffer-for-byte-swapping-for-.patch
new file mode 100644
index 0000000..4481717
--- /dev/null
+++ b/debian/patches/post-9beta2/0178-flacenc-use-a-separate-buffer-for-byte-swapping-for-.patch
@@ -0,0 +1,100 @@
+From 6a744d261930f8101132bc6d207b6eac41d9cf18 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Thu, 25 Oct 2012 15:00:10 -0400
+Subject: [PATCH 178/204] flacenc: use a separate buffer for byte-swapping for
+ MD5 checksum on big-endian
+
+This is much faster than calculating the MD5 one sample at a time.
+---
+ libavcodec/flacenc.c | 37 ++++++++++++++++++++++++++++---------
+ 1 file changed, 28 insertions(+), 9 deletions(-)
+
+diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
+index b135e4a..d321270 100644
+--- a/libavcodec/flacenc.c
++++ b/libavcodec/flacenc.c
+@@ -23,6 +23,7 @@
+ #include "libavutil/md5.h"
+ #include "libavutil/opt.h"
+ #include "avcodec.h"
++#include "dsputil.h"
+ #include "get_bits.h"
+ #include "golomb.h"
+ #include "internal.h"
+@@ -100,6 +101,9 @@ typedef struct FlacEncodeContext {
+ AVCodecContext *avctx;
+ LPCContext lpc_ctx;
+ struct AVMD5 *md5ctx;
++ uint8_t *md5_buffer;
++ unsigned int md5_buffer_size;
++ DSPContext dsp;
+ } FlacEncodeContext;
+
+
+@@ -378,6 +382,8 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
+ ret = ff_lpc_init(&s->lpc_ctx, avctx->frame_size,
+ s->options.max_prediction_order, FF_LPC_TYPE_LEVINSON);
+
++ ff_dsputil_init(&s->dsp, avctx);
++
+ dprint_compression_options(s);
+
+ return ret;
+@@ -1176,17 +1182,26 @@ static int write_frame(FlacEncodeContext *s, AVPacket *avpkt)
+ }
+
+
+-static void update_md5_sum(FlacEncodeContext *s, const int16_t *samples)
++static int update_md5_sum(FlacEncodeContext *s, const int16_t *samples)
+ {
+-#if HAVE_BIGENDIAN
+- int i;
+- for (i = 0; i < s->frame.blocksize * s->channels; i++) {
+- int16_t smp = av_le2ne16(samples[i]);
+- av_md5_update(s->md5ctx, (uint8_t *)&smp, 2);
++ const uint8_t *buf;
++ int buf_size = s->frame.blocksize * s->channels * 2;
++
++ if (HAVE_BIGENDIAN) {
++ av_fast_malloc(&s->md5_buffer, &s->md5_buffer_size, buf_size);
++ if (!s->md5_buffer)
++ return AVERROR(ENOMEM);
+ }
+-#else
+- av_md5_update(s->md5ctx, (const uint8_t *)samples, s->frame.blocksize*s->channels*2);
++
++ buf = (const uint8_t *)samples;
++#if HAVE_BIGENDIAN
++ s->dsp.bswap16_buf((uint16_t *)s->md5_buffer,
++ (const uint16_t *)samples, buf_size / 2);
++ buf = s->md5_buffer;
+ #endif
++ av_md5_update(s->md5ctx, buf, buf_size);
++
++ return 0;
+ }
+
+
+@@ -1238,7 +1253,10 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+
+ s->frame_count++;
+ s->sample_count += frame->nb_samples;
+- update_md5_sum(s, samples);
++ if ((ret = update_md5_sum(s, samples)) < 0) {
++ av_log(avctx, AV_LOG_ERROR, "Error updating MD5 checksum\n");
++ return ret;
++ }
+ if (out_bytes > s->max_encoded_framesize)
+ s->max_encoded_framesize = out_bytes;
+ if (out_bytes < s->min_framesize)
+@@ -1257,6 +1275,7 @@ static av_cold int flac_encode_close(AVCodecContext *avctx)
+ if (avctx->priv_data) {
+ FlacEncodeContext *s = avctx->priv_data;
+ av_freep(&s->md5ctx);
++ av_freep(&s->md5_buffer);
+ ff_lpc_end(&s->lpc_ctx);
+ }
+ av_freep(&avctx->extradata);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0179-lavu-add-av_ctz-for-trailing-zero-bit-count.patch b/debian/patches/post-9beta2/0179-lavu-add-av_ctz-for-trailing-zero-bit-count.patch
new file mode 100644
index 0000000..e95f92b
--- /dev/null
+++ b/debian/patches/post-9beta2/0179-lavu-add-av_ctz-for-trailing-zero-bit-count.patch
@@ -0,0 +1,211 @@
+From dfde8a34e5419ac99265e3ecc2e82f378674128a Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Fri, 26 Oct 2012 14:48:40 -0400
+Subject: [PATCH 179/204] lavu: add av_ctz() for trailing zero bit count
+
+---
+ doc/APIchanges | 3 +++
+ libavutil/Makefile | 2 +-
+ libavutil/intmath.c | 39 ++++++++++++++++++++++++++++++++++++
+ libavutil/intmath.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ libavutil/log2.c | 34 -------------------------------
+ libavutil/version.h | 2 +-
+ 6 files changed, 99 insertions(+), 36 deletions(-)
+ create mode 100644 libavutil/intmath.c
+ delete mode 100644 libavutil/log2.c
+
+diff --git a/doc/APIchanges b/doc/APIchanges
+index 24defe4..c8b8fbf 100644
+--- a/doc/APIchanges
++++ b/doc/APIchanges
+@@ -13,6 +13,9 @@ libavutil: 2012-10-22
+
+ API changes, most recent first:
+
++2012-xx-xx - xxxxxxx - lavu 52.1.0 - intmath.h
++ Add av_ctz() for trailing zero bit count
++
+ 2012-10-18 - xxxxxxx - lavu 51.45.0 - error.h
+ Add AVERROR_EXPERIMENTAL
+
+diff --git a/libavutil/Makefile b/libavutil/Makefile
+index 45f8e90..d4ffd5e 100644
+--- a/libavutil/Makefile
++++ b/libavutil/Makefile
+@@ -67,10 +67,10 @@ OBJS = adler32.o \
+ float_dsp.o \
+ imgutils.o \
+ intfloat_readwrite.o \
++ intmath.o \
+ lfg.o \
+ lls.o \
+ log.o \
+- log2.o \
+ log2_tab.o \
+ mathematics.o \
+ md5.o \
+diff --git a/libavutil/intmath.c b/libavutil/intmath.c
+new file mode 100644
+index 0000000..8db425c
+--- /dev/null
++++ b/libavutil/intmath.c
+@@ -0,0 +1,39 @@
++/*
++ * This file is part of Libav.
++ *
++ * Libav is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * Libav is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with Libav; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#include "intmath.h"
++
++/* undef these to get the function prototypes from common.h */
++#undef av_log2
++#undef av_log2_16bit
++#include "common.h"
++
++int av_log2(unsigned v)
++{
++ return ff_log2(v);
++}
++
++int av_log2_16bit(unsigned v)
++{
++ return ff_log2_16bit(v);
++}
++
++int av_ctz(int v)
++{
++ return ff_ctz(v);
++}
+diff --git a/libavutil/intmath.h b/libavutil/intmath.h
+index 2cb3132..a5ee652 100644
+--- a/libavutil/intmath.h
++++ b/libavutil/intmath.h
+@@ -88,4 +88,59 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
+ /**
+ * @}
+ */
++
++/**
++ * @addtogroup lavu_math
++ * @{
++ */
++
++#if HAVE_FAST_CLZ && AV_GCC_VERSION_AT_LEAST(3,4)
++#ifndef ff_ctz
++#define ff_ctz(v) __builtin_ctz(v)
++#endif
++#endif
++
++#ifndef ff_ctz
++#define ff_ctz ff_ctz_c
++static av_always_inline av_const int ff_ctz_c(int v)
++{
++ int c;
++
++ if (v & 0x1)
++ return 0;
++
++ c = 1;
++ if (!(v & 0xffff)) {
++ v >>= 16;
++ c += 16;
++ }
++ if (!(v & 0xff)) {
++ v >>= 8;
++ c += 8;
++ }
++ if (!(v & 0xf)) {
++ v >>= 4;
++ c += 4;
++ }
++ if (!(v & 0x3)) {
++ v >>= 2;
++ c += 2;
++ }
++ c -= v & 0x1;
++
++ return c;
++}
++#endif
++
++/**
++ * Trailing zero bit count.
++ *
++ * @param v input value. If v is 0, the result is undefined.
++ * @return the number of trailing 0-bits
++ */
++int av_ctz(int v);
++
++/**
++ * @}
++ */
+ #endif /* AVUTIL_INTMATH_H */
+diff --git a/libavutil/log2.c b/libavutil/log2.c
+deleted file mode 100644
+index 18c1b40..0000000
+--- a/libavutil/log2.c
++++ /dev/null
+@@ -1,34 +0,0 @@
+-/*
+- * This file is part of Libav.
+- *
+- * Libav is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Lesser General Public
+- * License as published by the Free Software Foundation; either
+- * version 2.1 of the License, or (at your option) any later version.
+- *
+- * Libav is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- * Lesser General Public License for more details.
+- *
+- * You should have received a copy of the GNU Lesser General Public
+- * License along with Libav; if not, write to the Free Software
+- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+- */
+-
+-#include "intmath.h"
+-
+-/* undef these to get the function prototypes from common.h */
+-#undef av_log2
+-#undef av_log2_16bit
+-#include "common.h"
+-
+-int av_log2(unsigned v)
+-{
+- return ff_log2(v);
+-}
+-
+-int av_log2_16bit(unsigned v)
+-{
+- return ff_log2_16bit(v);
+-}
+diff --git a/libavutil/version.h b/libavutil/version.h
+index ae7fa7a..1659dbd 100644
+--- a/libavutil/version.h
++++ b/libavutil/version.h
+@@ -37,7 +37,7 @@
+ */
+
+ #define LIBAVUTIL_VERSION_MAJOR 52
+-#define LIBAVUTIL_VERSION_MINOR 0
++#define LIBAVUTIL_VERSION_MINOR 1
+ #define LIBAVUTIL_VERSION_MICRO 0
+
+ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0180-flacenc-remove-wasted-trailing-0-bits.patch b/debian/patches/post-9beta2/0180-flacenc-remove-wasted-trailing-0-bits.patch
new file mode 100644
index 0000000..e6f3a37
--- /dev/null
+++ b/debian/patches/post-9beta2/0180-flacenc-remove-wasted-trailing-0-bits.patch
@@ -0,0 +1,98 @@
+From e78331632208a23b285a70b3cdd487dd54617c46 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Thu, 25 Oct 2012 15:07:59 -0400
+Subject: [PATCH 180/204] flacenc: remove wasted trailing 0 bits
+
+---
+ libavcodec/flacenc.c | 39 +++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 37 insertions(+), 2 deletions(-)
+
+diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
+index d321270..a96fa3b 100644
+--- a/libavcodec/flacenc.c
++++ b/libavcodec/flacenc.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include "libavutil/crc.h"
++#include "libavutil/intmath.h"
+ #include "libavutil/md5.h"
+ #include "libavutil/opt.h"
+ #include "avcodec.h"
+@@ -66,6 +67,7 @@ typedef struct FlacSubframe {
+ int type;
+ int type_code;
+ int obits;
++ int wasted;
+ int order;
+ int32_t coefs[MAX_LPC_ORDER];
+ int shift;
+@@ -416,8 +418,10 @@ static void init_frame(FlacEncodeContext *s, int nb_samples)
+ }
+ }
+
+- for (ch = 0; ch < s->channels; ch++)
++ for (ch = 0; ch < s->channels; ch++) {
++ frame->subframes[ch].wasted = 0;
+ frame->subframes[ch].obits = 16;
++ }
+
+ frame->verbatim_only = 0;
+ }
+@@ -972,6 +976,33 @@ static int encode_frame(FlacEncodeContext *s)
+ }
+
+
++static void remove_wasted_bits(FlacEncodeContext *s)
++{
++ int ch, i;
++
++ for (ch = 0; ch < s->channels; ch++) {
++ FlacSubframe *sub = &s->frame.subframes[ch];
++ int32_t v = 0;
++
++ for (i = 0; i < s->frame.blocksize; i++) {
++ v |= sub->samples[i];
++ if (v & 1)
++ break;
++ }
++
++ if (v && !(v & 1)) {
++ v = av_ctz(v);
++
++ for (i = 0; i < s->frame.blocksize; i++)
++ sub->samples[i] >>= v;
++
++ sub->wasted = v;
++ sub->obits -= v;
++ }
++ }
++}
++
++
+ static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n)
+ {
+ int i, best;
+@@ -1117,7 +1148,9 @@ static void write_subframes(FlacEncodeContext *s)
+ /* subframe header */
+ put_bits(&s->pb, 1, 0);
+ put_bits(&s->pb, 6, sub->type_code);
+- put_bits(&s->pb, 1, 0); /* no wasted bits */
++ put_bits(&s->pb, 1, !!sub->wasted);
++ if (sub->wasted)
++ put_bits(&s->pb, sub->wasted, 1);
+
+ /* subframe */
+ if (sub->type == FLAC_SUBFRAME_CONSTANT) {
+@@ -1235,6 +1268,8 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+
+ channel_decorrelation(s);
+
++ remove_wasted_bits(s);
++
+ frame_bytes = encode_frame(s);
+
+ /* fallback to verbatim mode if the compressed frame is larger than it
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0181-flacenc-use-uint64_t-for-bit-counts.patch b/debian/patches/post-9beta2/0181-flacenc-use-uint64_t-for-bit-counts.patch
new file mode 100644
index 0000000..b3fa768
--- /dev/null
+++ b/debian/patches/post-9beta2/0181-flacenc-use-uint64_t-for-bit-counts.patch
@@ -0,0 +1,206 @@
+From 5ff998a233d759d0de83ea6f95c383d03d25d88e Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Fri, 26 Oct 2012 23:22:38 -0400
+Subject: [PATCH 181/204] flacenc: use uint64_t for bit counts
+
+Needed to avoid integer overflows for 24-bit encoding.
+---
+ libavcodec/flacenc.c | 58 ++++++++++++++++++++++++++++----------------------
+ 1 file changed, 33 insertions(+), 25 deletions(-)
+
+diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
+index a96fa3b..115664a 100644
+--- a/libavcodec/flacenc.c
++++ b/libavcodec/flacenc.c
+@@ -442,10 +442,10 @@ static void copy_samples(FlacEncodeContext *s, const int16_t *samples)
+ }
+
+
+-static int rice_count_exact(int32_t *res, int n, int k)
++static uint64_t rice_count_exact(int32_t *res, int n, int k)
+ {
+ int i;
+- int count = 0;
++ uint64_t count = 0;
+
+ for (i = 0; i < n; i++) {
+ int32_t v = -2 * res[i] - 1;
+@@ -456,12 +456,12 @@ static int rice_count_exact(int32_t *res, int n, int k)
+ }
+
+
+-static int subframe_count_exact(FlacEncodeContext *s, FlacSubframe *sub,
+- int pred_order)
++static uint64_t subframe_count_exact(FlacEncodeContext *s, FlacSubframe *sub,
++ int pred_order)
+ {
+ int p, porder, psize;
+ int i, part_end;
+- int count = 0;
++ uint64_t count = 0;
+
+ /* subframe header */
+ count += 8;
+@@ -508,25 +508,25 @@ static int subframe_count_exact(FlacEncodeContext *s, FlacSubframe *sub,
+ /**
+ * Solve for d/dk(rice_encode_count) = n-((sum-(n>>1))>>(k+1)) = 0.
+ */
+-static int find_optimal_param(uint32_t sum, int n)
++static int find_optimal_param(uint64_t sum, int n)
+ {
+ int k;
+- uint32_t sum2;
++ uint64_t sum2;
+
+ if (sum <= n >> 1)
+ return 0;
+ sum2 = sum - (n >> 1);
+- k = av_log2(n < 256 ? FASTDIV(sum2, n) : sum2 / n);
++ k = av_log2(av_clipl_int32(sum2 / n));
+ return FFMIN(k, MAX_RICE_PARAM);
+ }
+
+
+-static uint32_t calc_optimal_rice_params(RiceContext *rc, int porder,
+- uint32_t *sums, int n, int pred_order)
++static uint64_t calc_optimal_rice_params(RiceContext *rc, int porder,
++ uint64_t *sums, int n, int pred_order)
+ {
+ int i;
+ int k, cnt, part;
+- uint32_t all_bits;
++ uint64_t all_bits;
+
+ part = (1 << porder);
+ all_bits = 4 * part;
+@@ -546,7 +546,7 @@ static uint32_t calc_optimal_rice_params(RiceContext *rc, int porder,
+
+
+ static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order,
+- uint32_t sums[][MAX_PARTITIONS])
++ uint64_t sums[][MAX_PARTITIONS])
+ {
+ int i, j;
+ int parts;
+@@ -557,7 +557,7 @@ static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order,
+ res = &data[pred_order];
+ res_end = &data[n >> pmax];
+ for (i = 0; i < parts; i++) {
+- uint32_t sum = 0;
++ uint64_t sum = 0;
+ while (res < res_end)
+ sum += *(res++);
+ sums[pmax][i] = sum;
+@@ -572,15 +572,15 @@ static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order,
+ }
+
+
+-static uint32_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
++static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
+ int32_t *data, int n, int pred_order)
+ {
+ int i;
+- uint32_t bits[MAX_PARTITION_ORDER+1];
++ uint64_t bits[MAX_PARTITION_ORDER+1];
+ int opt_porder;
+ RiceContext tmp_rc;
+ uint32_t *udata;
+- uint32_t sums[MAX_PARTITION_ORDER+1][MAX_PARTITIONS];
++ uint64_t sums[MAX_PARTITION_ORDER+1][MAX_PARTITIONS];
+
+ assert(pmin >= 0 && pmin <= MAX_PARTITION_ORDER);
+ assert(pmax >= 0 && pmax <= MAX_PARTITION_ORDER);
+@@ -616,7 +616,7 @@ static int get_max_p_order(int max_porder, int n, int order)
+ }
+
+
+-static uint32_t find_subframe_rice_params(FlacEncodeContext *s,
++static uint64_t find_subframe_rice_params(FlacEncodeContext *s,
+ FlacSubframe *sub, int pred_order)
+ {
+ int pmin = get_max_p_order(s->options.min_partition_order,
+@@ -624,7 +624,7 @@ static uint32_t find_subframe_rice_params(FlacEncodeContext *s,
+ int pmax = get_max_p_order(s->options.max_partition_order,
+ s->frame.blocksize, pred_order);
+
+- uint32_t bits = 8 + pred_order * sub->obits + 2 + 4;
++ uint64_t bits = 8 + pred_order * sub->obits + 2 + 4;
+ if (sub->type == FLAC_SUBFRAME_LPC)
+ bits += 4 + 5 + pred_order * s->options.lpc_coeff_precision;
+ bits += calc_rice_params(&sub->rc, pmin, pmax, sub->residual,
+@@ -829,7 +829,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ sub->type = FLAC_SUBFRAME_FIXED;
+ if (s->options.lpc_type == FF_LPC_TYPE_NONE ||
+ s->options.lpc_type == FF_LPC_TYPE_FIXED || n <= max_order) {
+- uint32_t bits[MAX_FIXED_ORDER+1];
++ uint64_t bits[MAX_FIXED_ORDER+1];
+ if (max_order > MAX_FIXED_ORDER)
+ max_order = MAX_FIXED_ORDER;
+ opt_order = 0;
+@@ -860,7 +860,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ omethod == ORDER_METHOD_4LEVEL ||
+ omethod == ORDER_METHOD_8LEVEL) {
+ int levels = 1 << omethod;
+- uint32_t bits[1 << ORDER_METHOD_8LEVEL];
++ uint64_t bits[1 << ORDER_METHOD_8LEVEL];
+ int order;
+ int opt_index = levels-1;
+ opt_order = max_order-1;
+@@ -879,7 +879,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ opt_order++;
+ } else if (omethod == ORDER_METHOD_SEARCH) {
+ // brute-force optimal order search
+- uint32_t bits[MAX_LPC_ORDER];
++ uint64_t bits[MAX_LPC_ORDER];
+ opt_order = 0;
+ bits[0] = UINT32_MAX;
+ for (i = min_order-1; i < max_order; i++) {
+@@ -890,7 +890,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ }
+ opt_order++;
+ } else if (omethod == ORDER_METHOD_LOG) {
+- uint32_t bits[MAX_LPC_ORDER];
++ uint64_t bits[MAX_LPC_ORDER];
+ int step;
+
+ opt_order = min_order - 1 + (max_order-min_order)/3;
+@@ -962,7 +962,8 @@ static int count_frame_header(FlacEncodeContext *s)
+
+ static int encode_frame(FlacEncodeContext *s)
+ {
+- int ch, count;
++ int ch;
++ uint64_t count;
+
+ count = count_frame_header(s);
+
+@@ -972,7 +973,10 @@ static int encode_frame(FlacEncodeContext *s)
+ count += (8 - (count & 7)) & 7; // byte alignment
+ count += 16; // CRC-16
+
+- return count >> 3;
++ count >>= 3;
++ if (count > INT_MAX)
++ return AVERROR_BUG;
++ return count;
+ }
+
+
+@@ -1274,9 +1278,13 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+
+ /* fallback to verbatim mode if the compressed frame is larger than it
+ would be if encoded uncompressed. */
+- if (frame_bytes > s->max_framesize) {
++ if (frame_bytes < 0 || frame_bytes > s->max_framesize) {
+ s->frame.verbatim_only = 1;
+ frame_bytes = encode_frame(s);
++ if (frame_bytes < 0) {
++ av_log(avctx, AV_LOG_ERROR, "Bad frame count\n");
++ return frame_bytes;
++ }
+ }
+
+ if ((ret = ff_alloc_packet(avpkt, frame_bytes))) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0182-flacdsp-move-lpc-encoding-from-FLAC-encoder-to-FLACD.patch b/debian/patches/post-9beta2/0182-flacdsp-move-lpc-encoding-from-FLAC-encoder-to-FLACD.patch
new file mode 100644
index 0000000..c0cba57
--- /dev/null
+++ b/debian/patches/post-9beta2/0182-flacdsp-move-lpc-encoding-from-FLAC-encoder-to-FLACD.patch
@@ -0,0 +1,391 @@
+From 799e2324901c2a06e9a60ee281cd283475f1c4fa Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sat, 27 Oct 2012 00:25:04 -0400
+Subject: [PATCH 182/204] flacdsp: move lpc encoding from FLAC encoder to
+ FLACDSPContext
+
+Also, templatize the functions for 16-bit and 32-bit sample range. This will
+be used for 24-bit FLAC encoding.
+---
+ libavcodec/flacdsp.c | 9 ++-
+ libavcodec/flacdsp.h | 2 +
+ libavcodec/flacdsp_lpc_template.c | 141 +++++++++++++++++++++++++++++++++++++
+ libavcodec/flacenc.c | 116 +++---------------------------
+ 4 files changed, 158 insertions(+), 110 deletions(-)
+ create mode 100644 libavcodec/flacdsp_lpc_template.c
+
+diff --git a/libavcodec/flacdsp.c b/libavcodec/flacdsp.c
+index 3f4f710..b916869 100644
+--- a/libavcodec/flacdsp.c
++++ b/libavcodec/flacdsp.c
+@@ -26,6 +26,7 @@
+ #define SAMPLE_SIZE 16
+ #define PLANAR 0
+ #include "flacdsp_template.c"
++#include "flacdsp_lpc_template.c"
+
+ #undef PLANAR
+ #define PLANAR 1
+@@ -36,6 +37,7 @@
+ #define SAMPLE_SIZE 32
+ #define PLANAR 0
+ #include "flacdsp_template.c"
++#include "flacdsp_lpc_template.c"
+
+ #undef PLANAR
+ #define PLANAR 1
+@@ -86,10 +88,13 @@ static void flac_lpc_32_c(int32_t *decoded, const int coeffs[32],
+ av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt,
+ int bps)
+ {
+- if (bps > 16)
++ if (bps > 16) {
+ c->lpc = flac_lpc_32_c;
+- else
++ c->lpc_encode = flac_lpc_encode_c_32;
++ } else {
+ c->lpc = flac_lpc_16_c;
++ c->lpc_encode = flac_lpc_encode_c_16;
++ }
+
+ switch (fmt) {
+ case AV_SAMPLE_FMT_S32:
+diff --git a/libavcodec/flacdsp.h b/libavcodec/flacdsp.h
+index 429daab..33184b5 100644
+--- a/libavcodec/flacdsp.h
++++ b/libavcodec/flacdsp.h
+@@ -27,6 +27,8 @@ typedef struct FLACDSPContext {
+ int len, int shift);
+ void (*lpc)(int32_t *samples, const int coeffs[32], int order,
+ int qlevel, int len);
++ void (*lpc_encode)(int32_t *res, const int32_t *smp, int len, int order,
++ const int32_t *coefs, int shift);
+ } FLACDSPContext;
+
+ void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int bps);
+diff --git a/libavcodec/flacdsp_lpc_template.c b/libavcodec/flacdsp_lpc_template.c
+new file mode 100644
+index 0000000..269e64b
+--- /dev/null
++++ b/libavcodec/flacdsp_lpc_template.c
+@@ -0,0 +1,141 @@
++/*
++ * This file is part of Libav.
++ *
++ * Libav is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * Libav is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with Libav; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#include <stdint.h>
++#include "libavutil/avutil.h"
++#include "mathops.h"
++
++#undef FUNC
++#undef sum_type
++#undef MUL
++#undef CLIP
++#undef FSUF
++
++#define FUNC(n) AV_JOIN(n ## _, SAMPLE_SIZE)
++
++#if SAMPLE_SIZE == 32
++# define sum_type int64_t
++# define MUL(a, b) MUL64(a, b)
++# define CLIP(x) av_clipl_int32(x)
++#else
++# define sum_type int32_t
++# define MUL(a, b) ((a) * (b))
++# define CLIP(x) (x)
++#endif
++
++#define LPC1(x) { \
++ int c = coefs[(x)-1]; \
++ p0 += MUL(c, s); \
++ s = smp[i-(x)+1]; \
++ p1 += MUL(c, s); \
++}
++
++static av_always_inline void FUNC(lpc_encode_unrolled)(int32_t *res,
++ const int32_t *smp, int len, int order,
++ const int32_t *coefs, int shift, int big)
++{
++ int i;
++ for (i = order; i < len; i += 2) {
++ int s = smp[i-order];
++ sum_type p0 = 0, p1 = 0;
++ if (big) {
++ switch (order) {
++ case 32: LPC1(32)
++ case 31: LPC1(31)
++ case 30: LPC1(30)
++ case 29: LPC1(29)
++ case 28: LPC1(28)
++ case 27: LPC1(27)
++ case 26: LPC1(26)
++ case 25: LPC1(25)
++ case 24: LPC1(24)
++ case 23: LPC1(23)
++ case 22: LPC1(22)
++ case 21: LPC1(21)
++ case 20: LPC1(20)
++ case 19: LPC1(19)
++ case 18: LPC1(18)
++ case 17: LPC1(17)
++ case 16: LPC1(16)
++ case 15: LPC1(15)
++ case 14: LPC1(14)
++ case 13: LPC1(13)
++ case 12: LPC1(12)
++ case 11: LPC1(11)
++ case 10: LPC1(10)
++ case 9: LPC1( 9)
++ LPC1( 8)
++ LPC1( 7)
++ LPC1( 6)
++ LPC1( 5)
++ LPC1( 4)
++ LPC1( 3)
++ LPC1( 2)
++ LPC1( 1)
++ }
++ } else {
++ switch (order) {
++ case 8: LPC1( 8)
++ case 7: LPC1( 7)
++ case 6: LPC1( 6)
++ case 5: LPC1( 5)
++ case 4: LPC1( 4)
++ case 3: LPC1( 3)
++ case 2: LPC1( 2)
++ case 1: LPC1( 1)
++ }
++ }
++ res[i ] = smp[i ] - CLIP(p0 >> shift);
++ res[i+1] = smp[i+1] - CLIP(p1 >> shift);
++ }
++}
++
++static void FUNC(flac_lpc_encode_c)(int32_t *res, const int32_t *smp, int len,
++ int order, const int32_t *coefs, int shift)
++{
++ int i;
++ for (i = 0; i < order; i++)
++ res[i] = smp[i];
++#if CONFIG_SMALL
++ for (i = order; i < len; i += 2) {
++ int j;
++ int s = smp[i];
++ sum_type p0 = 0, p1 = 0;
++ for (j = 0; j < order; j++) {
++ int c = coefs[j];
++ p1 += MUL(c, s);
++ s = smp[i-j-1];
++ p0 += MUL(c, s);
++ }
++ res[i ] = smp[i ] - CLIP(p0 >> shift);
++ res[i+1] = smp[i+1] - CLIP(p1 >> shift);
++ }
++#else
++ switch (order) {
++ case 1: FUNC(lpc_encode_unrolled)(res, smp, len, 1, coefs, shift, 0); break;
++ case 2: FUNC(lpc_encode_unrolled)(res, smp, len, 2, coefs, shift, 0); break;
++ case 3: FUNC(lpc_encode_unrolled)(res, smp, len, 3, coefs, shift, 0); break;
++ case 4: FUNC(lpc_encode_unrolled)(res, smp, len, 4, coefs, shift, 0); break;
++ case 5: FUNC(lpc_encode_unrolled)(res, smp, len, 5, coefs, shift, 0); break;
++ case 6: FUNC(lpc_encode_unrolled)(res, smp, len, 6, coefs, shift, 0); break;
++ case 7: FUNC(lpc_encode_unrolled)(res, smp, len, 7, coefs, shift, 0); break;
++ case 8: FUNC(lpc_encode_unrolled)(res, smp, len, 8, coefs, shift, 0); break;
++ default: FUNC(lpc_encode_unrolled)(res, smp, len, order, coefs, shift, 1); break;
++ }
++#endif
++}
+diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
+index 115664a..71024f2 100644
+--- a/libavcodec/flacenc.c
++++ b/libavcodec/flacenc.c
+@@ -31,6 +31,7 @@
+ #include "lpc.h"
+ #include "flac.h"
+ #include "flacdata.h"
++#include "flacdsp.h"
+
+ #define FLAC_SUBFRAME_CONSTANT 0
+ #define FLAC_SUBFRAME_VERBATIM 1
+@@ -106,6 +107,7 @@ typedef struct FlacEncodeContext {
+ uint8_t *md5_buffer;
+ unsigned int md5_buffer_size;
+ DSPContext dsp;
++ FLACDSPContext flac_dsp;
+ } FlacEncodeContext;
+
+
+@@ -385,6 +387,7 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
+ s->options.max_prediction_order, FF_LPC_TYPE_LEVINSON);
+
+ ff_dsputil_init(&s->dsp, avctx);
++ ff_flacdsp_init(&s->flac_dsp, avctx->sample_fmt, 16);
+
+ dprint_compression_options(s);
+
+@@ -684,110 +687,6 @@ static void encode_residual_fixed(int32_t *res, const int32_t *smp, int n,
+ }
+
+
+-#define LPC1(x) {\
+- int c = coefs[(x)-1];\
+- p0 += c * s;\
+- s = smp[i-(x)+1];\
+- p1 += c * s;\
+-}
+-
+-static av_always_inline void encode_residual_lpc_unrolled(int32_t *res,
+- const int32_t *smp, int n, int order,
+- const int32_t *coefs, int shift, int big)
+-{
+- int i;
+- for (i = order; i < n; i += 2) {
+- int s = smp[i-order];
+- int p0 = 0, p1 = 0;
+- if (big) {
+- switch (order) {
+- case 32: LPC1(32)
+- case 31: LPC1(31)
+- case 30: LPC1(30)
+- case 29: LPC1(29)
+- case 28: LPC1(28)
+- case 27: LPC1(27)
+- case 26: LPC1(26)
+- case 25: LPC1(25)
+- case 24: LPC1(24)
+- case 23: LPC1(23)
+- case 22: LPC1(22)
+- case 21: LPC1(21)
+- case 20: LPC1(20)
+- case 19: LPC1(19)
+- case 18: LPC1(18)
+- case 17: LPC1(17)
+- case 16: LPC1(16)
+- case 15: LPC1(15)
+- case 14: LPC1(14)
+- case 13: LPC1(13)
+- case 12: LPC1(12)
+- case 11: LPC1(11)
+- case 10: LPC1(10)
+- case 9: LPC1( 9)
+- LPC1( 8)
+- LPC1( 7)
+- LPC1( 6)
+- LPC1( 5)
+- LPC1( 4)
+- LPC1( 3)
+- LPC1( 2)
+- LPC1( 1)
+- }
+- } else {
+- switch (order) {
+- case 8: LPC1( 8)
+- case 7: LPC1( 7)
+- case 6: LPC1( 6)
+- case 5: LPC1( 5)
+- case 4: LPC1( 4)
+- case 3: LPC1( 3)
+- case 2: LPC1( 2)
+- case 1: LPC1( 1)
+- }
+- }
+- res[i ] = smp[i ] - (p0 >> shift);
+- res[i+1] = smp[i+1] - (p1 >> shift);
+- }
+-}
+-
+-
+-static void encode_residual_lpc(int32_t *res, const int32_t *smp, int n,
+- int order, const int32_t *coefs, int shift)
+-{
+- int i;
+- for (i = 0; i < order; i++)
+- res[i] = smp[i];
+-#if CONFIG_SMALL
+- for (i = order; i < n; i += 2) {
+- int j;
+- int s = smp[i];
+- int p0 = 0, p1 = 0;
+- for (j = 0; j < order; j++) {
+- int c = coefs[j];
+- p1 += c * s;
+- s = smp[i-j-1];
+- p0 += c * s;
+- }
+- res[i ] = smp[i ] - (p0 >> shift);
+- res[i+1] = smp[i+1] - (p1 >> shift);
+- }
+-#else
+- switch (order) {
+- case 1: encode_residual_lpc_unrolled(res, smp, n, 1, coefs, shift, 0); break;
+- case 2: encode_residual_lpc_unrolled(res, smp, n, 2, coefs, shift, 0); break;
+- case 3: encode_residual_lpc_unrolled(res, smp, n, 3, coefs, shift, 0); break;
+- case 4: encode_residual_lpc_unrolled(res, smp, n, 4, coefs, shift, 0); break;
+- case 5: encode_residual_lpc_unrolled(res, smp, n, 5, coefs, shift, 0); break;
+- case 6: encode_residual_lpc_unrolled(res, smp, n, 6, coefs, shift, 0); break;
+- case 7: encode_residual_lpc_unrolled(res, smp, n, 7, coefs, shift, 0); break;
+- case 8: encode_residual_lpc_unrolled(res, smp, n, 8, coefs, shift, 0); break;
+- default: encode_residual_lpc_unrolled(res, smp, n, order, coefs, shift, 1); break;
+- }
+-#endif
+-}
+-
+-
+ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ {
+ int i, n;
+@@ -869,7 +768,8 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1;
+ if (order < 0)
+ order = 0;
+- encode_residual_lpc(res, smp, n, order+1, coefs[order], shift[order]);
++ s->flac_dsp.lpc_encode(res, smp, n, order+1, coefs[order],
++ shift[order]);
+ bits[i] = find_subframe_rice_params(s, sub, order+1);
+ if (bits[i] < bits[opt_index]) {
+ opt_index = i;
+@@ -883,7 +783,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ opt_order = 0;
+ bits[0] = UINT32_MAX;
+ for (i = min_order-1; i < max_order; i++) {
+- encode_residual_lpc(res, smp, n, i+1, coefs[i], shift[i]);
++ s->flac_dsp.lpc_encode(res, smp, n, i+1, coefs[i], shift[i]);
+ bits[i] = find_subframe_rice_params(s, sub, i+1);
+ if (bits[i] < bits[opt_order])
+ opt_order = i;
+@@ -901,7 +801,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ for (i = last-step; i <= last+step; i += step) {
+ if (i < min_order-1 || i >= max_order || bits[i] < UINT32_MAX)
+ continue;
+- encode_residual_lpc(res, smp, n, i+1, coefs[i], shift[i]);
++ s->flac_dsp.lpc_encode(res, smp, n, i+1, coefs[i], shift[i]);
+ bits[i] = find_subframe_rice_params(s, sub, i+1);
+ if (bits[i] < bits[opt_order])
+ opt_order = i;
+@@ -916,7 +816,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ for (i = 0; i < sub->order; i++)
+ sub->coefs[i] = coefs[sub->order-1][i];
+
+- encode_residual_lpc(res, smp, n, sub->order, sub->coefs, sub->shift);
++ s->flac_dsp.lpc_encode(res, smp, n, sub->order, sub->coefs, sub->shift);
+
+ find_subframe_rice_params(s, sub, sub->order);
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0183-flacenc-add-24-bit-encoding.patch b/debian/patches/post-9beta2/0183-flacenc-add-24-bit-encoding.patch
new file mode 100644
index 0000000..94e8799
--- /dev/null
+++ b/debian/patches/post-9beta2/0183-flacenc-add-24-bit-encoding.patch
@@ -0,0 +1,216 @@
+From 13e1ee6c84f095b052026b18611ce68c76666474 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sat, 27 Oct 2012 00:26:02 -0400
+Subject: [PATCH 183/204] flacenc: add 24-bit encoding
+
+---
+ libavcodec/flacenc.c | 88 ++++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 63 insertions(+), 25 deletions(-)
+
+diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
+index 71024f2..b00df95 100644
+--- a/libavcodec/flacenc.c
++++ b/libavcodec/flacenc.c
+@@ -92,6 +92,7 @@ typedef struct FlacEncodeContext {
+ int channels;
+ int samplerate;
+ int sr_code[2];
++ int bps_code;
+ int max_blocksize;
+ int min_framesize;
+ int max_framesize;
+@@ -128,7 +129,7 @@ static void write_streaminfo(FlacEncodeContext *s, uint8_t *header)
+ put_bits(&pb, 24, s->max_framesize);
+ put_bits(&pb, 20, s->samplerate);
+ put_bits(&pb, 3, s->channels-1);
+- put_bits(&pb, 5, 15); /* bits per sample - 1 */
++ put_bits(&pb, 5, s->avctx->bits_per_raw_sample - 1);
+ /* write 36-bit sample count in 2 put_bits() calls */
+ put_bits(&pb, 24, (s->sample_count & 0xFFFFFF000LL) >> 12);
+ put_bits(&pb, 12, s->sample_count & 0x000000FFFLL);
+@@ -228,8 +229,18 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
+
+ s->avctx = avctx;
+
+- if (avctx->sample_fmt != AV_SAMPLE_FMT_S16)
+- return -1;
++ switch (avctx->sample_fmt) {
++ case AV_SAMPLE_FMT_S16:
++ avctx->bits_per_raw_sample = 16;
++ s->bps_code = 4;
++ break;
++ case AV_SAMPLE_FMT_S32:
++ if (avctx->bits_per_raw_sample != 24)
++ av_log(avctx, AV_LOG_WARNING, "encoding as 24 bits-per-sample\n");
++ avctx->bits_per_raw_sample = 24;
++ s->bps_code = 6;
++ break;
++ }
+
+ if (channels < 1 || channels > FLAC_MAX_CHANNELS)
+ return -1;
+@@ -359,7 +370,8 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
+
+ /* set maximum encoded frame size in verbatim mode */
+ s->max_framesize = ff_flac_get_max_frame_size(s->avctx->frame_size,
+- s->channels, 16);
++ s->channels,
++ s->avctx->bits_per_raw_sample);
+
+ /* initialize MD5 context */
+ s->md5ctx = av_md5_alloc();
+@@ -387,7 +399,8 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
+ s->options.max_prediction_order, FF_LPC_TYPE_LEVINSON);
+
+ ff_dsputil_init(&s->dsp, avctx);
+- ff_flacdsp_init(&s->flac_dsp, avctx->sample_fmt, 16);
++ ff_flacdsp_init(&s->flac_dsp, avctx->sample_fmt,
++ avctx->bits_per_raw_sample);
+
+ dprint_compression_options(s);
+
+@@ -423,7 +436,7 @@ static void init_frame(FlacEncodeContext *s, int nb_samples)
+
+ for (ch = 0; ch < s->channels; ch++) {
+ frame->subframes[ch].wasted = 0;
+- frame->subframes[ch].obits = 16;
++ frame->subframes[ch].obits = s->avctx->bits_per_raw_sample;
+ }
+
+ frame->verbatim_only = 0;
+@@ -433,15 +446,25 @@ static void init_frame(FlacEncodeContext *s, int nb_samples)
+ /**
+ * Copy channel-interleaved input samples into separate subframes.
+ */
+-static void copy_samples(FlacEncodeContext *s, const int16_t *samples)
++static void copy_samples(FlacEncodeContext *s, const void *samples)
+ {
+ int i, j, ch;
+ FlacFrame *frame;
+-
+- frame = &s->frame;
+- for (i = 0, j = 0; i < frame->blocksize; i++)
+- for (ch = 0; ch < s->channels; ch++, j++)
+- frame->subframes[ch].samples[i] = samples[j];
++ int shift = av_get_bytes_per_sample(s->avctx->sample_fmt) * 8 -
++ s->avctx->bits_per_raw_sample;
++
++#define COPY_SAMPLES(bits) do { \
++ const int ## bits ## _t *samples0 = samples; \
++ frame = &s->frame; \
++ for (i = 0, j = 0; i < frame->blocksize; i++) \
++ for (ch = 0; ch < s->channels; ch++, j++) \
++ frame->subframes[ch].samples[i] = samples0[j] >> shift; \
++} while (0)
++
++ if (s->avctx->sample_fmt == AV_SAMPLE_FMT_S16)
++ COPY_SAMPLES(16);
++ else
++ COPY_SAMPLES(32);
+ }
+
+
+@@ -1017,7 +1040,7 @@ static void write_frame_header(FlacEncodeContext *s)
+ else
+ put_bits(&s->pb, 4, frame->ch_mode + FLAC_MAX_CHANNELS - 1);
+
+- put_bits(&s->pb, 3, 4); /* bits-per-sample code */
++ put_bits(&s->pb, 3, s->bps_code);
+ put_bits(&s->pb, 1, 0);
+ write_utf8(&s->pb, s->frame_count);
+
+@@ -1119,23 +1142,38 @@ static int write_frame(FlacEncodeContext *s, AVPacket *avpkt)
+ }
+
+
+-static int update_md5_sum(FlacEncodeContext *s, const int16_t *samples)
++static int update_md5_sum(FlacEncodeContext *s, const void *samples)
+ {
+ const uint8_t *buf;
+- int buf_size = s->frame.blocksize * s->channels * 2;
++ int buf_size = s->frame.blocksize * s->channels *
++ ((s->avctx->bits_per_raw_sample + 7) / 8);
+
+- if (HAVE_BIGENDIAN) {
++ if (s->avctx->bits_per_raw_sample > 16 || HAVE_BIGENDIAN) {
+ av_fast_malloc(&s->md5_buffer, &s->md5_buffer_size, buf_size);
+ if (!s->md5_buffer)
+ return AVERROR(ENOMEM);
+ }
+
+- buf = (const uint8_t *)samples;
++ if (s->avctx->bits_per_raw_sample <= 16) {
++ buf = (const uint8_t *)samples;
+ #if HAVE_BIGENDIAN
+- s->dsp.bswap16_buf((uint16_t *)s->md5_buffer,
+- (const uint16_t *)samples, buf_size / 2);
+- buf = s->md5_buffer;
++ s->dsp.bswap16_buf((uint16_t *)s->md5_buffer,
++ (const uint16_t *)samples, buf_size / 2);
++ buf = s->md5_buffer;
+ #endif
++ } else {
++ int i;
++ const int32_t *samples0 = samples;
++ uint8_t *tmp = s->md5_buffer;
++
++ for (i = 0; i < s->frame.blocksize * s->channels; i++) {
++ int32_t v = samples0[i] >> 8;
++ *tmp++ = (v ) & 0xFF;
++ *tmp++ = (v >> 8) & 0xFF;
++ *tmp++ = (v >> 16) & 0xFF;
++ }
++ buf = s->md5_buffer;
++ }
+ av_md5_update(s->md5ctx, buf, buf_size);
+
+ return 0;
+@@ -1146,7 +1184,6 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+ const AVFrame *frame, int *got_packet_ptr)
+ {
+ FlacEncodeContext *s;
+- const int16_t *samples;
+ int frame_bytes, out_bytes, ret;
+
+ s = avctx->priv_data;
+@@ -1158,17 +1195,17 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+ write_streaminfo(s, avctx->extradata);
+ return 0;
+ }
+- samples = (const int16_t *)frame->data[0];
+
+ /* change max_framesize for small final frame */
+ if (frame->nb_samples < s->frame.blocksize) {
+ s->max_framesize = ff_flac_get_max_frame_size(frame->nb_samples,
+- s->channels, 16);
++ s->channels,
++ avctx->bits_per_raw_sample);
+ }
+
+ init_frame(s, frame->nb_samples);
+
+- copy_samples(s, samples);
++ copy_samples(s, frame->data[0]);
+
+ channel_decorrelation(s);
+
+@@ -1196,7 +1233,7 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+
+ s->frame_count++;
+ s->sample_count += frame->nb_samples;
+- if ((ret = update_md5_sum(s, samples)) < 0) {
++ if ((ret = update_md5_sum(s, frame->data[0])) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error updating MD5 checksum\n");
+ return ret;
+ }
+@@ -1273,6 +1310,7 @@ AVCodec ff_flac_encoder = {
+ .close = flac_encode_close,
+ .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
+ .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
++ AV_SAMPLE_FMT_S32,
+ AV_SAMPLE_FMT_NONE },
+ .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
+ .priv_class = &flac_encoder_class,
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0184-flacenc-use-RICE2-entropy-coding-mode-for-24-bit.patch b/debian/patches/post-9beta2/0184-flacenc-use-RICE2-entropy-coding-mode-for-24-bit.patch
new file mode 100644
index 0000000..064e48d
--- /dev/null
+++ b/debian/patches/post-9beta2/0184-flacenc-use-RICE2-entropy-coding-mode-for-24-bit.patch
@@ -0,0 +1,181 @@
+From 2e76f34387762405b79d2f7f26659826089c7275 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sat, 27 Oct 2012 00:46:43 -0400
+Subject: [PATCH 184/204] flacenc: use RICE2 entropy coding mode for 24-bit
+
+---
+ libavcodec/flacenc.c | 55 +++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 39 insertions(+), 16 deletions(-)
+
+diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
+index b00df95..93d4646 100644
+--- a/libavcodec/flacenc.c
++++ b/libavcodec/flacenc.c
+@@ -43,7 +43,11 @@
+ #define MAX_PARTITIONS (1 << MAX_PARTITION_ORDER)
+ #define MAX_LPC_PRECISION 15
+ #define MAX_LPC_SHIFT 15
+-#define MAX_RICE_PARAM 14
++
++enum CodingMode {
++ CODING_MODE_RICE = 4,
++ CODING_MODE_RICE2 = 5,
++};
+
+ typedef struct CompressionOptions {
+ int compression_level;
+@@ -60,6 +64,7 @@ typedef struct CompressionOptions {
+ } CompressionOptions;
+
+ typedef struct RiceContext {
++ enum CodingMode coding_mode;
+ int porder;
+ int params[MAX_PARTITIONS];
+ } RiceContext;
+@@ -435,8 +440,15 @@ static void init_frame(FlacEncodeContext *s, int nb_samples)
+ }
+
+ for (ch = 0; ch < s->channels; ch++) {
+- frame->subframes[ch].wasted = 0;
+- frame->subframes[ch].obits = s->avctx->bits_per_raw_sample;
++ FlacSubframe *sub = &frame->subframes[ch];
++
++ sub->wasted = 0;
++ sub->obits = s->avctx->bits_per_raw_sample;
++
++ if (sub->obits > 16)
++ sub->rc.coding_mode = CODING_MODE_RICE2;
++ else
++ sub->rc.coding_mode = CODING_MODE_RICE;
+ }
+
+ frame->verbatim_only = 0;
+@@ -518,7 +530,7 @@ static uint64_t subframe_count_exact(FlacEncodeContext *s, FlacSubframe *sub,
+ part_end = psize;
+ for (p = 0; p < 1 << porder; p++) {
+ int k = sub->rc.params[p];
+- count += 4;
++ count += sub->rc.coding_mode;
+ count += rice_count_exact(&sub->residual[i], part_end - i, k);
+ i = part_end;
+ part_end = FFMIN(s->frame.blocksize, part_end + psize);
+@@ -534,7 +546,7 @@ static uint64_t subframe_count_exact(FlacEncodeContext *s, FlacSubframe *sub,
+ /**
+ * Solve for d/dk(rice_encode_count) = n-((sum-(n>>1))>>(k+1)) = 0.
+ */
+-static int find_optimal_param(uint64_t sum, int n)
++static int find_optimal_param(uint64_t sum, int n, int max_param)
+ {
+ int k;
+ uint64_t sum2;
+@@ -543,7 +555,7 @@ static int find_optimal_param(uint64_t sum, int n)
+ return 0;
+ sum2 = sum - (n >> 1);
+ k = av_log2(av_clipl_int32(sum2 / n));
+- return FFMIN(k, MAX_RICE_PARAM);
++ return FFMIN(k, max_param);
+ }
+
+
+@@ -551,15 +563,17 @@ static uint64_t calc_optimal_rice_params(RiceContext *rc, int porder,
+ uint64_t *sums, int n, int pred_order)
+ {
+ int i;
+- int k, cnt, part;
++ int k, cnt, part, max_param;
+ uint64_t all_bits;
+
++ max_param = (1 << rc->coding_mode) - 2;
++
+ part = (1 << porder);
+ all_bits = 4 * part;
+
+ cnt = (n >> porder) - pred_order;
+ for (i = 0; i < part; i++) {
+- k = find_optimal_param(sums[i], cnt);
++ k = find_optimal_param(sums[i], cnt, max_param);
+ rc->params[i] = k;
+ all_bits += rice_encode_count(sums[i], cnt, k);
+ cnt = n >> porder;
+@@ -612,6 +626,8 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
+ assert(pmax >= 0 && pmax <= MAX_PARTITION_ORDER);
+ assert(pmin <= pmax);
+
++ tmp_rc.coding_mode = rc->coding_mode;
++
+ udata = av_malloc(n * sizeof(uint32_t));
+ for (i = 0; i < n; i++)
+ udata[i] = (2*data[i]) ^ (data[i]>>31);
+@@ -650,7 +666,7 @@ static uint64_t find_subframe_rice_params(FlacEncodeContext *s,
+ int pmax = get_max_p_order(s->options.max_partition_order,
+ s->frame.blocksize, pred_order);
+
+- uint64_t bits = 8 + pred_order * sub->obits + 2 + 4;
++ uint64_t bits = 8 + pred_order * sub->obits + 2 + sub->rc.coding_mode;
+ if (sub->type == FLAC_SUBFRAME_LPC)
+ bits += 4 + 5 + pred_order * s->options.lpc_coeff_precision;
+ bits += calc_rice_params(&sub->rc, pmin, pmax, sub->residual,
+@@ -925,12 +941,18 @@ static void remove_wasted_bits(FlacEncodeContext *s)
+
+ sub->wasted = v;
+ sub->obits -= v;
++
++ /* for 24-bit, check if removing wasted bits makes the range better
++ suited for using RICE instead of RICE2 for entropy coding */
++ if (sub->obits <= 17)
++ sub->rc.coding_mode = CODING_MODE_RICE;
+ }
+ }
+ }
+
+
+-static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n)
++static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n,
++ int max_rice_param)
+ {
+ int i, best;
+ int32_t lt, rt;
+@@ -950,7 +972,7 @@ static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n)
+ }
+ /* estimate bit counts */
+ for (i = 0; i < 4; i++) {
+- k = find_optimal_param(2 * sum[i], n);
++ k = find_optimal_param(2 * sum[i], n, max_rice_param);
+ sum[i] = rice_encode_count( 2 * sum[i], n, k);
+ }
+
+@@ -989,9 +1011,10 @@ static void channel_decorrelation(FlacEncodeContext *s)
+ return;
+ }
+
+- if (s->options.ch_mode < 0)
+- frame->ch_mode = estimate_stereo_mode(left, right, n);
+- else
++ if (s->options.ch_mode < 0) {
++ int max_rice_param = (1 << frame->subframes[0].rc.coding_mode) - 2;
++ frame->ch_mode = estimate_stereo_mode(left, right, n, max_rice_param);
++ } else
+ frame->ch_mode = s->options.ch_mode;
+
+ /* perform decorrelation and adjust bits-per-sample */
+@@ -1100,7 +1123,7 @@ static void write_subframes(FlacEncodeContext *s)
+ }
+
+ /* rice-encoded block */
+- put_bits(&s->pb, 2, 0);
++ put_bits(&s->pb, 2, sub->rc.coding_mode - 4);
+
+ /* partition order */
+ porder = sub->rc.porder;
+@@ -1111,7 +1134,7 @@ static void write_subframes(FlacEncodeContext *s)
+ part_end = &sub->residual[psize];
+ for (p = 0; p < 1 << porder; p++) {
+ int k = sub->rc.params[p];
+- put_bits(&s->pb, 4, k);
++ put_bits(&s->pb, sub->rc.coding_mode, k);
+ while (res < part_end)
+ set_sr_golomb_flac(&s->pb, *res++, k, INT32_MAX, 0);
+ part_end = FFMIN(frame_end, part_end + psize);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0185-FATE-rename-FLAC-tests-from-flac-to-flac-16.patch b/debian/patches/post-9beta2/0185-FATE-rename-FLAC-tests-from-flac-to-flac-16.patch
new file mode 100644
index 0000000..d3b3dea
--- /dev/null
+++ b/debian/patches/post-9beta2/0185-FATE-rename-FLAC-tests-from-flac-to-flac-16.patch
@@ -0,0 +1,49 @@
+From 31c3b9c95e2b14189f2bc9f2bd886834114da81d Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Sat, 27 Oct 2012 01:22:07 -0400
+Subject: [PATCH 185/204] FATE: rename FLAC tests from flac-* to flac-16-*
+
+This will distinguish FLAC 16-bit tests from FLAC tests with other bit
+depths.
+---
+ tests/fate/flac.mak | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/tests/fate/flac.mak b/tests/fate/flac.mak
+index dc49928..f7ac342 100644
+--- a/tests/fate/flac.mak
++++ b/tests/fate/flac.mak
+@@ -1,17 +1,18 @@
+-FATE_FLAC += fate-flac-chmode-indep \
+- fate-flac-chmode-left_side \
+- fate-flac-chmode-mid_side \
+- fate-flac-chmode-right_side \
+- fate-flac-fixed \
+- fate-flac-lpc-cholesky \
+- fate-flac-lpc-levinson \
++FATE_FLAC += fate-flac-16-chmode-indep \
++ fate-flac-16-chmode-left_side \
++ fate-flac-16-chmode-mid_side \
++ fate-flac-16-chmode-right_side \
++ fate-flac-16-fixed \
++ fate-flac-16-lpc-cholesky \
++ fate-flac-16-lpc-levinson \
+
+-fate-flac-chmode-%: OPTS = -ch_mode $(@:fate-flac-chmode-%=%)
+-fate-flac-fixed: OPTS = -lpc_type fixed
+-fate-flac-lpc-%: OPTS = -lpc_type $(@:fate-flac-lpc-%=%)
++fate-flac-16-chmode-%: OPTS = -ch_mode $(@:fate-flac-16-chmode-%=%)
++fate-flac-16-fixed: OPTS = -lpc_type fixed
++fate-flac-16-lpc-%: OPTS = -lpc_type $(@:fate-flac-16-lpc-%=%)
++
++fate-flac-16-%: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
++fate-flac-16-%: CMD = enc_dec_pcm flac wav s16le $(REF) -c flac $(OPTS)
+
+-fate-flac-%: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
+-fate-flac-%: CMD = enc_dec_pcm flac wav s16le $(REF) -c flac $(OPTS)
+ fate-flac-%: CMP = oneoff
+ fate-flac-%: FUZZ = 0
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0186-FATE-add-a-24-bit-FLAC-encoding-test.patch b/debian/patches/post-9beta2/0186-FATE-add-a-24-bit-FLAC-encoding-test.patch
new file mode 100644
index 0000000..4e5e68f
--- /dev/null
+++ b/debian/patches/post-9beta2/0186-FATE-add-a-24-bit-FLAC-encoding-test.patch
@@ -0,0 +1,36 @@
+From 8a58894fc63c9d367c4cd6a17e277d1a8608c2c0 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 5 Nov 2012 12:49:36 -0500
+Subject: [PATCH 186/204] FATE: add a 24-bit FLAC encoding test
+
+---
+ tests/fate/flac.mak | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/tests/fate/flac.mak b/tests/fate/flac.mak
+index f7ac342..92eb743 100644
+--- a/tests/fate/flac.mak
++++ b/tests/fate/flac.mak
+@@ -5,6 +5,7 @@ FATE_FLAC += fate-flac-16-chmode-indep \
+ fate-flac-16-fixed \
+ fate-flac-16-lpc-cholesky \
+ fate-flac-16-lpc-levinson \
++ fate-flac-24-comp-8 \
+
+ fate-flac-16-chmode-%: OPTS = -ch_mode $(@:fate-flac-16-chmode-%=%)
+ fate-flac-16-fixed: OPTS = -lpc_type fixed
+@@ -13,6 +14,11 @@ fate-flac-16-lpc-%: OPTS = -lpc_type $(@:fate-flac-16-lpc-%=%)
+ fate-flac-16-%: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
+ fate-flac-16-%: CMD = enc_dec_pcm flac wav s16le $(REF) -c flac $(OPTS)
+
++fate-flac-24-comp-%: OPTS = -compression_level $(@:fate-flac-24-comp-%=%)
++
++fate-flac-24-%: REF = $(SAMPLES)/audio-reference/divertimenti_2ch_96kHz_s24.wav
++fate-flac-24-%: CMD = enc_dec_pcm flac wav s24le $(REF) -c flac $(OPTS)
++
+ fate-flac-%: CMP = oneoff
+ fate-flac-%: FUZZ = 0
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0187-x86-avresample-Add-missing-colons-to-assembly-labels.patch b/debian/patches/post-9beta2/0187-x86-avresample-Add-missing-colons-to-assembly-labels.patch
new file mode 100644
index 0000000..73ce61d
--- /dev/null
+++ b/debian/patches/post-9beta2/0187-x86-avresample-Add-missing-colons-to-assembly-labels.patch
@@ -0,0 +1,36 @@
+From 352e18b766650d298a3ba54f757259220746b03b Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Tue, 6 Nov 2012 12:07:35 +0100
+Subject: [PATCH 187/204] x86: avresample: Add missing colons to assembly
+ labels
+
+YASM accepts labels without colons, but NASM issues warnings.
+---
+ libavresample/x86/audio_convert.asm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavresample/x86/audio_convert.asm b/libavresample/x86/audio_convert.asm
+index e7f7157..567a916 100644
+--- a/libavresample/x86/audio_convert.asm
++++ b/libavresample/x86/audio_convert.asm
+@@ -247,7 +247,7 @@ cglobal conv_s16p_to_s16_2ch, 3,4,5, dst, src0, len, src1
+ add src1q, lenq
+ lea dstq, [dstq+2*lenq]
+ neg lenq
+-.loop
++.loop:
+ mova m0, [src0q+lenq ]
+ mova m1, [src1q+lenq ]
+ mova m2, [src0q+lenq+mmsize]
+@@ -716,7 +716,7 @@ cglobal conv_fltp_to_flt_2ch, 3,4,5, dst, src0, len, src1
+ add src1q, lenq
+ lea dstq, [dstq+2*lenq]
+ neg lenq
+-.loop
++.loop:
+ mova m0, [src0q+lenq ]
+ mova m1, [src1q+lenq ]
+ mova m2, [src0q+lenq+mmsize]
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0188-fate-aac-cosmetics-Group-AAC-LATM-tests-together.patch b/debian/patches/post-9beta2/0188-fate-aac-cosmetics-Group-AAC-LATM-tests-together.patch
new file mode 100644
index 0000000..9ccddd7
--- /dev/null
+++ b/debian/patches/post-9beta2/0188-fate-aac-cosmetics-Group-AAC-LATM-tests-together.patch
@@ -0,0 +1,50 @@
+From 06c7b33831451761c6f8c2e3ca8f2d7340d603a0 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sat, 20 Oct 2012 12:19:54 +0200
+Subject: [PATCH 188/204] fate: aac: cosmetics: Group AAC LATM tests together
+
+---
+ tests/fate/aac.mak | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak
+index 0368798..ea738c5 100644
+--- a/tests/fate/aac.mak
++++ b/tests/fate/aac.mak
+@@ -46,18 +46,10 @@ FATE_AAC += fate-aac-al_sbr_ps_06_ur
+ fate-aac-al_sbr_ps_06_ur: CMD = pcm -i $(SAMPLES)/aac/al_sbr_ps_06_new.mp4
+ fate-aac-al_sbr_ps_06_ur: REF = $(SAMPLES)/aac/al_sbr_ps_06_ur.s16
+
+-FATE_AAC_LATM += fate-aac-latm_000000001180bc60
+-fate-aac-latm_000000001180bc60: CMD = pcm -i $(SAMPLES)/aac/latm_000000001180bc60.mpg
+-fate-aac-latm_000000001180bc60: REF = $(SAMPLES)/aac/latm_000000001180bc60.s16
+-
+ FATE_AAC += fate-aac-ap05_48
+ fate-aac-ap05_48: CMD = pcm -i $(SAMPLES)/aac/ap05_48.mp4
+ fate-aac-ap05_48: REF = $(SAMPLES)/aac/ap05_48.s16
+
+-FATE_AAC_LATM += fate-aac-latm_stereo_to_51
+-fate-aac-latm_stereo_to_51: CMD = pcm -i $(SAMPLES)/aac/latm_stereo_to_51.ts -channel_layout 5.1
+-fate-aac-latm_stereo_to_51: REF = $(SAMPLES)/aac/latm_stereo_to_51_ref.s16
+-
+ fate-aac-ct%: CMD = pcm -i $(SAMPLES)/aac/CT_DecoderCheck/$(@:fate-aac-ct-%=%)
+ fate-aac-ct%: REF = $(SAMPLES)/aac/CT_DecoderCheck/aacPlusv2.wav
+
+@@ -71,6 +63,14 @@ FATE_AAC_CT = sbr_bc-ps_i.3gp \
+
+ FATE_AAC += $(FATE_AAC_CT:%=fate-aac-ct-%)
+
++FATE_AAC_LATM += fate-aac-latm_000000001180bc60
++fate-aac-latm_000000001180bc60: CMD = pcm -i $(SAMPLES)/aac/latm_000000001180bc60.mpg
++fate-aac-latm_000000001180bc60: REF = $(SAMPLES)/aac/latm_000000001180bc60.s16
++
++FATE_AAC_LATM += fate-aac-latm_stereo_to_51
++fate-aac-latm_stereo_to_51: CMD = pcm -i $(SAMPLES)/aac/latm_stereo_to_51.ts -channel_layout 5.1
++fate-aac-latm_stereo_to_51: REF = $(SAMPLES)/aac/latm_stereo_to_51_ref.s16
++
+ FATE_AAC_ALL = $(FATE_AAC) $(FATE_AAC_LATM)
+
+ $(FATE_AAC_ALL): CMP = oneoff
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0189-fate-atrac-Place-atrac1-and-atrac3-tests-in-differen.patch b/debian/patches/post-9beta2/0189-fate-atrac-Place-atrac1-and-atrac3-tests-in-differen.patch
new file mode 100644
index 0000000..6bc0f1c
--- /dev/null
+++ b/debian/patches/post-9beta2/0189-fate-atrac-Place-atrac1-and-atrac3-tests-in-differen.patch
@@ -0,0 +1,49 @@
+From e6c4c0f7cfaf0378a70f6f7f0611d4c21433067a Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sat, 20 Oct 2012 01:09:33 +0200
+Subject: [PATCH 189/204] fate: atrac: Place atrac1 and atrac3 tests in
+ different groups
+
+---
+ tests/fate/atrac.mak | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/tests/fate/atrac.mak b/tests/fate/atrac.mak
+index 08a6b25..39b788a 100644
+--- a/tests/fate/atrac.mak
++++ b/tests/fate/atrac.mak
+@@ -1,20 +1,24 @@
+-FATE_ATRAC += fate-atrac1
++FATE_ATRAC1 += fate-atrac1
+ fate-atrac1: CMD = pcm -i $(SAMPLES)/atrac1/test_tones_small.aea
+ fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm
+
+-FATE_ATRAC += fate-atrac3-1
++FATE_ATRAC3 += fate-atrac3-1
+ fate-atrac3-1: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_066_small.wav
+ fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm
+
+-FATE_ATRAC += fate-atrac3-2
++FATE_ATRAC3 += fate-atrac3-2
+ fate-atrac3-2: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_105_small.wav
+ fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm
+
+-FATE_ATRAC += fate-atrac3-3
++FATE_ATRAC3 += fate-atrac3-3
+ fate-atrac3-3: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_132_small.wav
+ fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm
+
+-$(FATE_ATRAC): CMP = oneoff
++FATE_ATRAC_ALL = $(FATE_ATRAC1) $(FATE_ATRAC3)
+
+-FATE_SAMPLES_AVCONV += $(FATE_ATRAC)
+-fate-atrac: $(FATE_ATRAC)
++$(FATE_ATRAC_ALL): CMP = oneoff
++
++FATE_SAMPLES_AVCONV += $(FATE_ATRAC_ALL)
++
++fate-atrac: $(FATE_ATRAC_ALL)
++fate-atrac3: $(FATE_ATRAC3)
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0190-libopencore-amr-Check-the-return-value-of-amr_decode.patch b/debian/patches/post-9beta2/0190-libopencore-amr-Check-the-return-value-of-amr_decode.patch
new file mode 100644
index 0000000..c12b909
--- /dev/null
+++ b/debian/patches/post-9beta2/0190-libopencore-amr-Check-the-return-value-of-amr_decode.patch
@@ -0,0 +1,92 @@
+From ad961726dc0bec7435aae7fbab10471b9063018b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 6 Nov 2012 12:18:57 +0200
+Subject: [PATCH 190/204] libopencore-amr: Check the return value of
+ amr_decode_fix_avctx
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This allows getting rid of redundant checks later in the codec
+specific init functions.
+
+Move the check to before actually initializing the decoder lib,
+to simplify error handling.
+
+This fixes a case of returning a value from a void function, present since
+d40dab907.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavcodec/libopencore-amr.c | 25 ++++++++++---------------
+ 1 file changed, 10 insertions(+), 15 deletions(-)
+
+diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
+index a754d52..0c472b7 100644
+--- a/libavcodec/libopencore-amr.c
++++ b/libavcodec/libopencore-amr.c
+@@ -27,7 +27,7 @@
+ #include "audio_frame_queue.h"
+ #include "internal.h"
+
+-static void amr_decode_fix_avctx(AVCodecContext *avctx)
++static int amr_decode_fix_avctx(AVCodecContext *avctx)
+ {
+ const int is_amr_wb = 1 + (avctx->codec_id == AV_CODEC_ID_AMR_WB);
+
+@@ -41,6 +41,7 @@ static void amr_decode_fix_avctx(AVCodecContext *avctx)
+ avctx->channels = 1;
+ avctx->channel_layout = AV_CH_LAYOUT_MONO;
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
++ return 0;
+ }
+
+ #if CONFIG_LIBOPENCORE_AMRNB
+@@ -107,6 +108,10 @@ static const AVClass class = {
+ static av_cold int amr_nb_decode_init(AVCodecContext *avctx)
+ {
+ AMRContext *s = avctx->priv_data;
++ int ret;
++
++ if ((ret = amr_decode_fix_avctx(avctx)) < 0)
++ return ret;
+
+ s->dec_state = Decoder_Interface_init();
+ if (!s->dec_state) {
+@@ -114,13 +119,6 @@ static av_cold int amr_nb_decode_init(AVCodecContext *avctx)
+ return -1;
+ }
+
+- amr_decode_fix_avctx(avctx);
+-
+- if (avctx->channels > 1) {
+- av_log(avctx, AV_LOG_ERROR, "amr_nb: multichannel decoding not supported\n");
+- return AVERROR(ENOSYS);
+- }
+-
+ avcodec_get_frame_defaults(&s->frame);
+ avctx->coded_frame = &s->frame;
+
+@@ -324,15 +322,12 @@ typedef struct AMRWBContext {
+ static av_cold int amr_wb_decode_init(AVCodecContext *avctx)
+ {
+ AMRWBContext *s = avctx->priv_data;
++ int ret;
+
+- s->state = D_IF_init();
+-
+- amr_decode_fix_avctx(avctx);
++ if ((ret = amr_decode_fix_avctx(avctx)) < 0)
++ return ret;
+
+- if (avctx->channels > 1) {
+- av_log(avctx, AV_LOG_ERROR, "amr_wb: multichannel decoding not supported\n");
+- return AVERROR(ENOSYS);
+- }
++ s->state = D_IF_init();
+
+ avcodec_get_frame_defaults(&s->frame);
+ avctx->coded_frame = &s->frame;
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0191-libvpxenc-Allow-enabling-constrained-quality-CQ-mode.patch b/debian/patches/post-9beta2/0191-libvpxenc-Allow-enabling-constrained-quality-CQ-mode.patch
new file mode 100644
index 0000000..002ff90
--- /dev/null
+++ b/debian/patches/post-9beta2/0191-libvpxenc-Allow-enabling-constrained-quality-CQ-mode.patch
@@ -0,0 +1,84 @@
+From 12776d5d2a46363c52603ae2be888a3094fce1c6 Mon Sep 17 00:00:00 2001
+From: James Zern <jzern at google.com>
+Date: Mon, 11 Apr 2011 17:00:35 -0700
+Subject: [PATCH 191/204] libvpxenc: Allow enabling constrained quality (CQ)
+ mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The CQ mode was introduced in libvpx 0.9.6.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ configure | 4 ++--
+ libavcodec/libvpxenc.c | 10 ++++++++--
+ 2 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index 9528b5d..515a3c9 100755
+--- a/configure
++++ b/configure
+@@ -3344,8 +3344,8 @@ enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lv
+ enabled libvpx && {
+ enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
+ die "ERROR: libvpx decoder version must be >=0.9.1"; }
+- enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_enc_init_ver -lvpx ||
+- die "ERROR: libvpx encoder version must be >=0.9.1"; } }
++ enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_CQ" -lvpx ||
++ die "ERROR: libvpx encoder version must be >=0.9.6"; } }
+ enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
+ { check_cpp_condition x264.h "X264_BUILD >= 118" ||
+ die "ERROR: libx264 version must be >= 0.118."; }
+diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
+index f505d0e..9774d5a 100644
+--- a/libavcodec/libvpxenc.c
++++ b/libavcodec/libvpxenc.c
+@@ -64,6 +64,7 @@ typedef struct VP8EncoderContext {
+ int arnr_type;
+ int lag_in_frames;
+ int error_resilient;
++ int crf;
+ } VP8Context;
+
+ /** String mappings for enum vp8e_enc_control_id */
+@@ -84,6 +85,7 @@ static const char *const ctlidstr[] = {
+ [VP8E_SET_ARNR_MAXFRAMES] = "VP8E_SET_ARNR_MAXFRAMES",
+ [VP8E_SET_ARNR_STRENGTH] = "VP8E_SET_ARNR_STRENGTH",
+ [VP8E_SET_ARNR_TYPE] = "VP8E_SET_ARNR_TYPE",
++ [VP8E_SET_CQ_LEVEL] = "VP8E_SET_CQ_LEVEL",
+ };
+
+ static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc)
+@@ -251,8 +253,10 @@ static av_cold int vp8_init(AVCodecContext *avctx)
+ enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
+ AV_ROUND_NEAR_INF);
+
+- if (avctx->rc_min_rate == avctx->rc_max_rate &&
+- avctx->rc_min_rate == avctx->bit_rate)
++ if (ctx->crf)
++ enccfg.rc_end_usage = VPX_CQ;
++ else if (avctx->rc_min_rate == avctx->rc_max_rate &&
++ avctx->rc_min_rate == avctx->bit_rate)
+ enccfg.rc_end_usage = VPX_CBR;
+
+ if (avctx->qmin > 0)
+@@ -343,6 +347,7 @@ static av_cold int vp8_init(AVCodecContext *avctx)
+ codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction);
+ codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS, av_log2(avctx->slices));
+ codecctl_int(avctx, VP8E_SET_STATIC_THRESHOLD, avctx->mb_threshold);
++ codecctl_int(avctx, VP8E_SET_CQ_LEVEL, ctx->crf);
+
+ //provide dummy value to initialize wrapper, values will be updated each _encode()
+ vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,
+@@ -553,6 +558,7 @@ static const AVOption options[] = {
+ "though earlier partitions have been lost. Note that intra predicition"
+ " is still done over the partition boundary.", 0, AV_OPT_TYPE_CONST, {.i64 = VPX_ERROR_RESILIENT_PARTITIONS}, 0, 0, VE, "er"},
+ #endif
++ { "crf", "Select the quality for constant quality mode", offsetof(VP8Context, crf), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE },
+ { NULL }
+ };
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0192-x86-h264_intrapred-port-to-cpuflags.patch b/debian/patches/post-9beta2/0192-x86-h264_intrapred-port-to-cpuflags.patch
new file mode 100644
index 0000000..0c1f404
--- /dev/null
+++ b/debian/patches/post-9beta2/0192-x86-h264_intrapred-port-to-cpuflags.patch
@@ -0,0 +1,637 @@
+From 6ca60d4ddd9b34b98b8570d440d79736d060f02a Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Tue, 10 Jul 2012 00:04:18 +0200
+Subject: [PATCH 192/204] x86: h264_intrapred: port to cpuflags
+
+---
+ libavcodec/x86/h264_intrapred.asm | 230 +++++++++++++++++++------------------
+ 1 file changed, 119 insertions(+), 111 deletions(-)
+
+diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
+index 94d979c..dc3d475 100644
+--- a/libavcodec/x86/h264_intrapred.asm
++++ b/libavcodec/x86/h264_intrapred.asm
+@@ -52,7 +52,8 @@ cextern pw_32
+ ; void pred16x16_vertical(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-cglobal pred16x16_vertical_8_mmx, 2,3
++INIT_MMX mmx
++cglobal pred16x16_vertical_8, 2,3
+ sub r0, r1
+ mov r2, 8
+ movq mm0, [r0+0]
+@@ -67,7 +68,8 @@ cglobal pred16x16_vertical_8_mmx, 2,3
+ jg .loop
+ REP_RET
+
+-cglobal pred16x16_vertical_8_sse, 2,3
++INIT_XMM sse
++cglobal pred16x16_vertical_8, 2,3
+ sub r0, r1
+ mov r2, 4
+ movaps xmm0, [r0]
+@@ -122,7 +124,6 @@ INIT_MMX mmx2
+ PRED16x16_H
+ INIT_XMM ssse3
+ PRED16x16_H
+-INIT_XMM
+
+ ;-----------------------------------------------------------------------------
+ ; void pred16x16_dc(uint8_t *src, int stride)
+@@ -185,13 +186,12 @@ INIT_XMM sse2
+ PRED16x16_DC
+ INIT_XMM ssse3
+ PRED16x16_DC
+-INIT_XMM
+
+ ;-----------------------------------------------------------------------------
+ ; void pred16x16_tm_vp8(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-%macro PRED16x16_TM_MMX 0
++%macro PRED16x16_TM 0
+ cglobal pred16x16_tm_vp8_8, 2,5
+ sub r0, r1
+ pxor mm7, mm7
+@@ -228,12 +228,12 @@ cglobal pred16x16_tm_vp8_8, 2,5
+ %endmacro
+
+ INIT_MMX mmx
+-PRED16x16_TM_MMX
++PRED16x16_TM
+ INIT_MMX mmx2
+-PRED16x16_TM_MMX
+-INIT_MMX
++PRED16x16_TM
+
+-cglobal pred16x16_tm_vp8_8_sse2, 2,6,6
++INIT_XMM sse2
++cglobal pred16x16_tm_vp8_8, 2,6,6
+ sub r0, r1
+ pxor xmm2, xmm2
+ movdqa xmm0, [r0]
+@@ -548,7 +548,6 @@ INIT_XMM ssse3
+ H264_PRED16x16_PLANE h264
+ H264_PRED16x16_PLANE rv40
+ H264_PRED16x16_PLANE svq3
+-INIT_XMM
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8_plane(uint8_t *src, int stride)
+@@ -723,13 +722,13 @@ INIT_XMM sse2
+ H264_PRED8x8_PLANE
+ INIT_XMM ssse3
+ H264_PRED8x8_PLANE
+-INIT_XMM
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8_vertical(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-cglobal pred8x8_vertical_8_mmx, 2,2
++INIT_MMX mmx
++cglobal pred8x8_vertical_8, 2,2
+ sub r0, r1
+ movq mm0, [r0]
+ %rep 3
+@@ -768,12 +767,12 @@ INIT_MMX mmx2
+ PRED8x8_H
+ INIT_MMX ssse3
+ PRED8x8_H
+-INIT_MMX
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8_top_dc_mmxext(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-cglobal pred8x8_top_dc_8_mmxext, 2,5
++INIT_MMX mmxext
++cglobal pred8x8_top_dc_8, 2,5
+ sub r0, r1
+ movq mm0, [r0]
+ pxor mm1, mm1
+@@ -807,8 +806,8 @@ cglobal pred8x8_top_dc_8_mmxext, 2,5
+ ; void pred8x8_dc_mmxext(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
+-cglobal pred8x8_dc_8_mmxext, 2,5
++INIT_MMX mmxext
++cglobal pred8x8_dc_8, 2,5
+ sub r0, r1
+ pxor m7, m7
+ movd m0, [r0+0]
+@@ -868,7 +867,8 @@ cglobal pred8x8_dc_8_mmxext, 2,5
+ ; void pred8x8_dc_rv40(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-cglobal pred8x8_dc_rv40_8_mmxext, 2,7
++INIT_MMX mmxext
++cglobal pred8x8_dc_rv40_8, 2,7
+ mov r4, r0
+ sub r0, r1
+ pxor mm0, mm0
+@@ -904,7 +904,7 @@ cglobal pred8x8_dc_rv40_8_mmxext, 2,7
+ ; void pred8x8_tm_vp8(uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+
+-%macro PRED8x8_TM_MMX 0
++%macro PRED8x8_TM 0
+ cglobal pred8x8_tm_vp8_8, 2,6
+ sub r0, r1
+ pxor mm7, mm7
+@@ -940,12 +940,12 @@ cglobal pred8x8_tm_vp8_8, 2,6
+ %endmacro
+
+ INIT_MMX mmx
+-PRED8x8_TM_MMX
++PRED8x8_TM
+ INIT_MMX mmx2
+-PRED8x8_TM_MMX
+-INIT_MMX
++PRED8x8_TM
+
+-cglobal pred8x8_tm_vp8_8_sse2, 2,6,4
++INIT_XMM sse2
++cglobal pred8x8_tm_vp8_8, 2,6,4
+ sub r0, r1
+ pxor xmm1, xmm1
+ movq xmm0, [r0]
+@@ -973,7 +973,8 @@ cglobal pred8x8_tm_vp8_8_sse2, 2,6,4
+ jg .loop
+ REP_RET
+
+-cglobal pred8x8_tm_vp8_8_ssse3, 2,3,6
++INIT_XMM ssse3
++cglobal pred8x8_tm_vp8_8, 2,3,6
+ sub r0, r1
+ movdqa xmm4, [tm_shuf]
+ pxor xmm1, xmm1
+@@ -1014,8 +1015,8 @@ cglobal pred8x8_tm_vp8_8_ssse3, 2,3,6
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_top_dc(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro PRED8x8L_TOP_DC 1
+-cglobal pred8x8l_top_dc_8_%1, 4,4
++%macro PRED8x8L_TOP_DC 0
++cglobal pred8x8l_top_dc_8, 4,4
+ sub r0, r3
+ pxor mm7, mm7
+ movq mm0, [r0-8]
+@@ -1061,18 +1062,19 @@ cglobal pred8x8l_top_dc_8_%1, 4,4
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_TOP_DC mmxext
++PRED8x8L_TOP_DC
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_TOP_DC ssse3
++PRED8x8L_TOP_DC
+
+ ;-----------------------------------------------------------------------------
+ ;void pred8x8l_dc(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-%macro PRED8x8L_DC 1
+-cglobal pred8x8l_dc_8_%1, 4,5
++%macro PRED8x8L_DC 0
++cglobal pred8x8l_dc_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1164,18 +1166,20 @@ cglobal pred8x8l_dc_8_%1, 4,5
+ movq [r4+r3*2], mm0
+ RET
+ %endmacro
+-INIT_MMX
++
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_DC mmxext
++PRED8x8L_DC
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_DC ssse3
++PRED8x8L_DC
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_horizontal(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-%macro PRED8x8L_HORIZONTAL 1
+-cglobal pred8x8l_horizontal_8_%1, 4,4
++%macro PRED8x8L_HORIZONTAL 0
++cglobal pred8x8l_horizontal_8, 4,4
+ sub r0, r3
+ lea r2, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1236,18 +1240,19 @@ cglobal pred8x8l_horizontal_8_%1, 4,4
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_HORIZONTAL mmxext
++PRED8x8L_HORIZONTAL
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_HORIZONTAL ssse3
++PRED8x8L_HORIZONTAL
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_vertical(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-%macro PRED8x8L_VERTICAL 1
+-cglobal pred8x8l_vertical_8_%1, 4,4
++%macro PRED8x8L_VERTICAL 0
++cglobal pred8x8l_vertical_8, 4,4
+ sub r0, r3
+ movq mm0, [r0-8]
+ movq mm3, [r0]
+@@ -1287,19 +1292,20 @@ cglobal pred8x8l_vertical_8_%1, 4,4
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_VERTICAL mmxext
++PRED8x8L_VERTICAL
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_VERTICAL ssse3
++PRED8x8L_VERTICAL
+
+ ;-----------------------------------------------------------------------------
+ ;void pred8x8l_down_left(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred8x8l_down_left_8_mmxext, 4,5
++cglobal pred8x8l_down_left_8, 4,5
+ sub r0, r3
+ movq mm0, [r0-8]
+ movq mm3, [r0]
+@@ -1406,8 +1412,8 @@ cglobal pred8x8l_down_left_8_mmxext, 4,5
+ movq [r0+r3*1], mm1
+ RET
+
+-%macro PRED8x8L_DOWN_LEFT 1
+-cglobal pred8x8l_down_left_8_%1, 4,4
++%macro PRED8x8L_DOWN_LEFT 0
++cglobal pred8x8l_down_left_8, 4,4
+ sub r0, r3
+ movq mm0, [r0-8]
+ movq mm3, [r0]
+@@ -1467,7 +1473,7 @@ cglobal pred8x8l_down_left_8_%1, 4,4
+ lea r2, [r1+r3*2]
+ movdqa xmm1, xmm3
+ pslldq xmm1, 1
+-INIT_XMM
++INIT_XMM cpuname
+ PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm4
+ psrldq xmm0, 1
+ movq [r0+r3*1], xmm0
+@@ -1489,20 +1495,20 @@ INIT_XMM
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_DOWN_LEFT sse2
+-INIT_MMX
++PRED8x8L_DOWN_LEFT
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_DOWN_LEFT ssse3
++PRED8x8L_DOWN_LEFT
+
+ ;-----------------------------------------------------------------------------
+ ;void pred8x8l_down_right_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred8x8l_down_right_8_mmxext, 4,5
++cglobal pred8x8l_down_right_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1633,8 +1639,8 @@ cglobal pred8x8l_down_right_8_mmxext, 4,5
+ movq [r0+r3*1], mm0
+ RET
+
+-%macro PRED8x8L_DOWN_RIGHT 1
+-cglobal pred8x8l_down_right_8_%1, 4,5
++%macro PRED8x8L_DOWN_RIGHT 0
++cglobal pred8x8l_down_right_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1722,7 +1728,7 @@ cglobal pred8x8l_down_right_8_%1, 4,5
+ lea r0, [r2+r3*2]
+ movdqa xmm2, xmm3
+ psrldq xmm2, 1
+-INIT_XMM
++INIT_XMM cpuname
+ PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm4
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+@@ -1743,20 +1749,20 @@ INIT_XMM
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_DOWN_RIGHT sse2
+-INIT_MMX
++PRED8x8L_DOWN_RIGHT
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_DOWN_RIGHT ssse3
++PRED8x8L_DOWN_RIGHT
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_vertical_right(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred8x8l_vertical_right_8_mmxext, 4,5
++cglobal pred8x8l_vertical_right_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -1862,8 +1868,8 @@ cglobal pred8x8l_vertical_right_8_mmxext, 4,5
+ movq [r4+r3*2], mm5
+ RET
+
+-%macro PRED8x8L_VERTICAL_RIGHT 1
+-cglobal pred8x8l_vertical_right_8_%1, 4,5,7
++%macro PRED8x8L_VERTICAL_RIGHT 0
++cglobal pred8x8l_vertical_right_8, 4,5,7
+ ; manually spill XMM registers for Win64 because
+ ; the code here is initialized with INIT_MMX
+ WIN64_SPILL_XMM 7
+@@ -1944,7 +1950,7 @@ cglobal pred8x8l_vertical_right_8_%1, 4,5,7
+ pslldq xmm0, 1
+ pslldq xmm1, 2
+ pavgb xmm2, xmm0
+-INIT_XMM
++INIT_XMM cpuname
+ PRED4x4_LOWPASS xmm4, xmm3, xmm1, xmm0, xmm5
+ pandn xmm6, xmm4
+ movdqa xmm5, xmm4
+@@ -1973,19 +1979,19 @@ INIT_XMM
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_VERTICAL_RIGHT sse2
+-INIT_MMX
++PRED8x8L_VERTICAL_RIGHT
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_VERTICAL_RIGHT ssse3
++PRED8x8L_VERTICAL_RIGHT
+
+ ;-----------------------------------------------------------------------------
+ ;void pred8x8l_vertical_left(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-%macro PRED8x8L_VERTICAL_LEFT 1
+-cglobal pred8x8l_vertical_left_8_%1, 4,4
++%macro PRED8x8L_VERTICAL_LEFT 0
++cglobal pred8x8l_vertical_left_8, 4,4
+ sub r0, r3
+ movq mm0, [r0-8]
+ movq mm3, [r0]
+@@ -2043,7 +2049,7 @@ cglobal pred8x8l_vertical_left_8_%1, 4,4
+ pslldq xmm1, 1
+ pavgb xmm3, xmm2
+ lea r2, [r1+r3*2]
+-INIT_XMM
++INIT_XMM cpuname
+ PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm4, xmm5
+ psrldq xmm0, 1
+ movq [r0+r3*1], xmm3
+@@ -2064,19 +2070,19 @@ INIT_XMM
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_VERTICAL_LEFT sse2
++PRED8x8L_VERTICAL_LEFT
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-INIT_MMX
+-PRED8x8L_VERTICAL_LEFT ssse3
++PRED8x8L_VERTICAL_LEFT
+
+ ;-----------------------------------------------------------------------------
+ ; void pred8x8l_horizontal_up(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-%macro PRED8x8L_HORIZONTAL_UP 1
+-cglobal pred8x8l_horizontal_up_8_%1, 4,4
++%macro PRED8x8L_HORIZONTAL_UP 0
++cglobal pred8x8l_horizontal_up_8, 4,4
+ sub r0, r3
+ lea r2, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -2153,19 +2159,20 @@ cglobal pred8x8l_horizontal_up_8_%1, 4,4
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_HORIZONTAL_UP mmxext
++PRED8x8L_HORIZONTAL_UP
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_HORIZONTAL_UP ssse3
++PRED8x8L_HORIZONTAL_UP
+
+ ;-----------------------------------------------------------------------------
+ ;void pred8x8l_horizontal_down(uint8_t *src, int has_topleft, int has_topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred8x8l_horizontal_down_8_mmxext, 4,5
++cglobal pred8x8l_horizontal_down_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -2279,8 +2286,8 @@ cglobal pred8x8l_horizontal_down_8_mmxext, 4,5
+ movq [r0+r3*1], mm3
+ RET
+
+-%macro PRED8x8L_HORIZONTAL_DOWN 1
+-cglobal pred8x8l_horizontal_down_8_%1, 4,5
++%macro PRED8x8L_HORIZONTAL_DOWN 0
++cglobal pred8x8l_horizontal_down_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+ movq mm0, [r0+r3*1-8]
+@@ -2372,7 +2379,7 @@ cglobal pred8x8l_horizontal_down_8_%1, 4,5
+ movq2dq xmm5, mm1
+ pslldq xmm5, 8
+ por xmm1, xmm5
+-INIT_XMM
++INIT_XMM cpuname
+ lea r2, [r4+r3*2]
+ movdqa xmm2, xmm1
+ movdqa xmm3, xmm1
+@@ -2403,18 +2410,19 @@ INIT_XMM
+ RET
+ %endmacro
+
+-INIT_MMX
++INIT_MMX sse2
+ %define PALIGNR PALIGNR_MMX
+-PRED8x8L_HORIZONTAL_DOWN sse2
+-INIT_MMX
++PRED8x8L_HORIZONTAL_DOWN
++INIT_MMX ssse3
+ %define PALIGNR PALIGNR_SSSE3
+-PRED8x8L_HORIZONTAL_DOWN ssse3
++PRED8x8L_HORIZONTAL_DOWN
+
+ ;-----------------------------------------------------------------------------
+ ; void pred4x4_dc_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-cglobal pred4x4_dc_8_mmxext, 3,5
++INIT_MMX mmxext
++cglobal pred4x4_dc_8, 3,5
+ pxor mm7, mm7
+ mov r4, r0
+ sub r0, r2
+@@ -2443,7 +2451,7 @@ cglobal pred4x4_dc_8_mmxext, 3,5
+ ; void pred4x4_tm_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-%macro PRED4x4_TM_MMX 0
++%macro PRED4x4_TM 0
+ cglobal pred4x4_tm_vp8_8, 3,6
+ sub r0, r2
+ pxor mm7, mm7
+@@ -2480,12 +2488,12 @@ cglobal pred4x4_tm_vp8_8, 3,6
+ %endmacro
+
+ INIT_MMX mmx
+-PRED4x4_TM_MMX
++PRED4x4_TM
+ INIT_MMX mmx2
+-PRED4x4_TM_MMX
+-INIT_MMX
++PRED4x4_TM
+
+-cglobal pred4x4_tm_vp8_8_ssse3, 3,3
++INIT_XMM ssse3
++cglobal pred4x4_tm_vp8_8, 3,3
+ sub r0, r2
+ movq mm6, [tm_shuf]
+ pxor mm1, mm1
+@@ -2524,8 +2532,8 @@ cglobal pred4x4_tm_vp8_8_ssse3, 3,3
+ ; void pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
+-cglobal pred4x4_vertical_vp8_8_mmxext, 3,3
++INIT_MMX mmxext
++cglobal pred4x4_vertical_vp8_8, 3,3
+ sub r0, r2
+ movd m1, [r0-1]
+ movd m0, [r0]
+@@ -2543,8 +2551,8 @@ cglobal pred4x4_vertical_vp8_8_mmxext, 3,3
+ ;-----------------------------------------------------------------------------
+ ; void pred4x4_down_left_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+-INIT_MMX
+-cglobal pred4x4_down_left_8_mmxext, 3,3
++INIT_MMX mmxext
++cglobal pred4x4_down_left_8, 3,3
+ sub r0, r2
+ movq m1, [r0]
+ punpckldq m1, [r1]
+@@ -2570,8 +2578,8 @@ cglobal pred4x4_down_left_8_mmxext, 3,3
+ ; void pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
+-cglobal pred4x4_vertical_left_8_mmxext, 3,3
++INIT_MMX mmxext
++cglobal pred4x4_vertical_left_8, 3,3
+ sub r0, r2
+ movq m1, [r0]
+ punpckldq m1, [r1]
+@@ -2595,8 +2603,8 @@ cglobal pred4x4_vertical_left_8_mmxext, 3,3
+ ; void pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
+-cglobal pred4x4_horizontal_up_8_mmxext, 3,3
++INIT_MMX mmxext
++cglobal pred4x4_horizontal_up_8, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movd m0, [r0+r2*1-4]
+@@ -2628,9 +2636,9 @@ cglobal pred4x4_horizontal_up_8_mmxext, 3,3
+ ; void pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred4x4_horizontal_down_8_mmxext, 3,3
++cglobal pred4x4_horizontal_down_8, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movh m0, [r0-4] ; lt ..
+@@ -2664,9 +2672,9 @@ cglobal pred4x4_horizontal_down_8_mmxext, 3,3
+ ; void pred4x4_vertical_right_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred4x4_vertical_right_8_mmxext, 3,3
++cglobal pred4x4_vertical_right_8, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movh m0, [r0] ; ........t3t2t1t0
+@@ -2695,9 +2703,9 @@ cglobal pred4x4_vertical_right_8_mmxext, 3,3
+ ; void pred4x4_down_right_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+ ;-----------------------------------------------------------------------------
+
+-INIT_MMX
++INIT_MMX mmxext
+ %define PALIGNR PALIGNR_MMX
+-cglobal pred4x4_down_right_8_mmxext, 3,3
++cglobal pred4x4_down_right_8, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+ movq m1, [r1-8]
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0193-rtpenc_aac-Fix-calculation-of-the-header-size.patch b/debian/patches/post-9beta2/0193-rtpenc_aac-Fix-calculation-of-the-header-size.patch
new file mode 100644
index 0000000..419bc0d
--- /dev/null
+++ b/debian/patches/post-9beta2/0193-rtpenc_aac-Fix-calculation-of-the-header-size.patch
@@ -0,0 +1,35 @@
+From e004d175fe2463af8242e390b15350f4745be7b4 Mon Sep 17 00:00:00 2001
+From: Luca Abeni <lucabe72 at email.it>
+Date: Thu, 8 Nov 2012 01:38:50 +0100
+Subject: [PATCH 193/204] rtpenc_aac: Fix calculation of the header size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Previously the high end byte was always set to zero. Also get
+rid of an unnecessary multiplication (which in practice couldn't
+overflow) before shifting.
+
+Signed-off-by: Martin Storsjö <martin at martin.st>
+---
+ libavformat/rtpenc_aac.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavformat/rtpenc_aac.c b/libavformat/rtpenc_aac.c
+index 86318df..1b2fa0a 100644
+--- a/libavformat/rtpenc_aac.c
++++ b/libavformat/rtpenc_aac.c
+@@ -47,8 +47,8 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
+ memmove(p + 2, s->buf + 2, au_size);
+ }
+ /* Write the AU header size */
+- p[0] = ((au_size * 8) & 0xFF) >> 8;
+- p[1] = (au_size * 8) & 0xFF;
++ p[0] = au_size >> 5;
++ p[1] = (au_size & 0x1F) << 3;
+
+ ff_rtp_send_data(s1, p, s->buf_ptr - p, 1);
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0194-add-24-bit-FLAC-encoding-to-Changelog.patch b/debian/patches/post-9beta2/0194-add-24-bit-FLAC-encoding-to-Changelog.patch
new file mode 100644
index 0000000..5244514
--- /dev/null
+++ b/debian/patches/post-9beta2/0194-add-24-bit-FLAC-encoding-to-Changelog.patch
@@ -0,0 +1,32 @@
+From 00f8ad41c78df71c464e98d2c1171a40f205db78 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Mon, 5 Nov 2012 15:36:19 -0500
+Subject: [PATCH 194/204] add 24-bit FLAC encoding to Changelog
+
+Also move a misplaced line from the 9_beta2 section to <next>
+---
+ Changelog | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/Changelog b/Changelog
+index e2c4273..f8079d1 100644
+--- a/Changelog
++++ b/Changelog
+@@ -2,9 +2,13 @@ Entries are sorted chronologically from oldest to youngest within each release,
+ releases are sorted from youngest to oldest.
+
+ version <next>:
++- ashowinfo audio filter
++- 24-bit FLAC encoding
++
++
++version 9_beta2:
+ - metadata (INFO tag) support in WAV muxer
+ - support for building DLLs using MSVC
+-- ashowinfo audio filter
+
+
+ version 9_beta1:
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0195-avconv-rescale-packet-duration-to-muxer-time-base-wh.patch b/debian/patches/post-9beta2/0195-avconv-rescale-packet-duration-to-muxer-time-base-wh.patch
new file mode 100644
index 0000000..e826ec1
--- /dev/null
+++ b/debian/patches/post-9beta2/0195-avconv-rescale-packet-duration-to-muxer-time-base-wh.patch
@@ -0,0 +1,27 @@
+From 3ba416408aef99b4d7d92719c0a03dc2c9647025 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Tue, 6 Nov 2012 14:24:31 -0500
+Subject: [PATCH 195/204] avconv: rescale packet duration to muxer time base
+ when flushing encoders
+
+Fixes Bug 385
+---
+ avconv.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/avconv.c b/avconv.c
+index 964847a..c931c46 100644
+--- a/avconv.c
++++ b/avconv.c
+@@ -964,6 +964,8 @@ static void flush_encoders(void)
+ pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);
+ if (pkt.dts != AV_NOPTS_VALUE)
+ pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
++ if (pkt.duration > 0)
++ pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base);
+ write_frame(os, &pkt, ost);
+ }
+
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0196-flacenc-ensure-the-order-is-within-the-min-max-range.patch b/debian/patches/post-9beta2/0196-flacenc-ensure-the-order-is-within-the-min-max-range.patch
new file mode 100644
index 0000000..7a6c30a
--- /dev/null
+++ b/debian/patches/post-9beta2/0196-flacenc-ensure-the-order-is-within-the-min-max-range.patch
@@ -0,0 +1,40 @@
+From 3a2731cbd31d0c5681ddbc7c78edd5c53c4d0032 Mon Sep 17 00:00:00 2001
+From: Justin Ruggles <justin.ruggles at gmail.com>
+Date: Wed, 7 Nov 2012 14:48:28 -0500
+Subject: [PATCH 196/204] flacenc: ensure the order is within the min/max
+ range in LPC order search
+
+This fixes use of uninitialized values when the FLAC encoder uses the
+2-level, 4-level, and 8-level search methods. Fixes failure of the
+fate-flac-24-comp-8 test when run using valgrind.
+---
+ libavcodec/flacenc.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
+index 93d4646..54bc64c 100644
+--- a/libavcodec/flacenc.c
++++ b/libavcodec/flacenc.c
+@@ -799,14 +799,16 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
+ omethod == ORDER_METHOD_8LEVEL) {
+ int levels = 1 << omethod;
+ uint64_t bits[1 << ORDER_METHOD_8LEVEL];
+- int order;
++ int order = -1;
+ int opt_index = levels-1;
+ opt_order = max_order-1;
+ bits[opt_index] = UINT32_MAX;
+ for (i = levels-1; i >= 0; i--) {
++ int last_order = order;
+ order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1;
+- if (order < 0)
+- order = 0;
++ order = av_clip(order, min_order - 1, max_order - 1);
++ if (order == last_order)
++ continue;
+ s->flac_dsp.lpc_encode(res, smp, n, order+1, coefs[order],
+ shift[order]);
+ bits[i] = find_subframe_rice_params(s, sub, order+1);
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0197-x86-h264_qpel_10bit-port-to-cpuflags.patch b/debian/patches/post-9beta2/0197-x86-h264_qpel_10bit-port-to-cpuflags.patch
new file mode 100644
index 0000000..1d33990
--- /dev/null
+++ b/debian/patches/post-9beta2/0197-x86-h264_qpel_10bit-port-to-cpuflags.patch
@@ -0,0 +1,668 @@
+From 4d1f69f2440041b58d5a31bcfcff83ee3c88ac7e Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Mon, 30 Jul 2012 17:04:26 +0200
+Subject: [PATCH 197/204] x86: h264_qpel_10bit: port to cpuflags
+
+---
+ libavcodec/x86/h264_qpel_10bit.asm | 314 ++++++++++++++++++------------------
+ 1 file changed, 155 insertions(+), 159 deletions(-)
+
+diff --git a/libavcodec/x86/h264_qpel_10bit.asm b/libavcodec/x86/h264_qpel_10bit.asm
+index a84b810..4aea032 100644
+--- a/libavcodec/x86/h264_qpel_10bit.asm
++++ b/libavcodec/x86/h264_qpel_10bit.asm
+@@ -97,81 +97,73 @@ SECTION .text
+
+ %macro MC 1
+ %define OP_MOV mova
+-INIT_MMX
+-%1 mmxext, put, 4
+-INIT_XMM
+-%1 sse2 , put, 8
++INIT_MMX mmxext
++%1 put, 4
++INIT_XMM sse2
++%1 put, 8
+
+ %define OP_MOV AVG_MOV
+-INIT_MMX
+-%1 mmxext, avg, 4
+-INIT_XMM
+-%1 sse2 , avg, 8
++INIT_MMX mmxext
++%1 avg, 4
++INIT_XMM sse2
++%1 avg, 8
+ %endmacro
+
+-%macro MCAxA 8
+-%if ARCH_X86_64
+-%ifnidn %1,mmxext
+-MCAxA_OP %1,%2,%3,%4,%5,%6,%7,%8
+-%endif
+-%else
+-MCAxA_OP %1,%2,%3,%4,%5,%6,%7,%8
+-%endif
+-%endmacro
+-
+-%macro MCAxA_OP 8
++%macro MCAxA_OP 7
+ %if ARCH_X86_32
+-cglobal %2_h264_qpel%5_%3_10_%1, %6,%7,%8
+- call stub_%2_h264_qpel%4_%3_10_%1
++cglobal %1_h264_qpel%4_%2_10, %5,%6,%7
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
+ mov r0, r0m
+ mov r1, r1m
+- add r0, %4*2
+- add r1, %4*2
+- call stub_%2_h264_qpel%4_%3_10_%1
++ add r0, %3*2
++ add r1, %3*2
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
+ mov r0, r0m
+ mov r1, r1m
+- lea r0, [r0+r2*%4]
+- lea r1, [r1+r2*%4]
+- call stub_%2_h264_qpel%4_%3_10_%1
++ lea r0, [r0+r2*%3]
++ lea r1, [r1+r2*%3]
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
+ mov r0, r0m
+ mov r1, r1m
+- lea r0, [r0+r2*%4+%4*2]
+- lea r1, [r1+r2*%4+%4*2]
+- call stub_%2_h264_qpel%4_%3_10_%1
++ lea r0, [r0+r2*%3+%3*2]
++ lea r1, [r1+r2*%3+%3*2]
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
+ RET
+ %else ; ARCH_X86_64
+-cglobal %2_h264_qpel%5_%3_10_%1, %6,%7 + 2,%8
+- mov r%7, r0
+-%assign p1 %7+1
++cglobal %1_h264_qpel%4_%2_10, %5,%6 + 2,%7
++ mov r%6, r0
++%assign p1 %6+1
+ mov r %+ p1, r1
+- call stub_%2_h264_qpel%4_%3_10_%1
+- lea r0, [r%7+%4*2]
+- lea r1, [r %+ p1+%4*2]
+- call stub_%2_h264_qpel%4_%3_10_%1
+- lea r0, [r%7+r2*%4]
+- lea r1, [r %+ p1+r2*%4]
+- call stub_%2_h264_qpel%4_%3_10_%1
+- lea r0, [r%7+r2*%4+%4*2]
+- lea r1, [r %+ p1+r2*%4+%4*2]
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
++ lea r0, [r%6+%3*2]
++ lea r1, [r %+ p1+%3*2]
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
++ lea r0, [r%6+r2*%3]
++ lea r1, [r %+ p1+r2*%3]
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
++ lea r0, [r%6+r2*%3+%3*2]
++ lea r1, [r %+ p1+r2*%3+%3*2]
+ %if UNIX64 == 0 ; fall through to function
+- call stub_%2_h264_qpel%4_%3_10_%1
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
+ RET
+ %endif
+ %endif
+ %endmacro
+
+ ;cpu, put/avg, mc, 4/8, ...
+-%macro cglobal_mc 7
+-%assign i %4*2
+-MCAxA %1, %2, %3, %4, i, %5,%6,%7
++%macro cglobal_mc 6
++%assign i %3*2
++%if ARCH_X86_32 || cpuflag(sse2)
++MCAxA_OP %1, %2, %3, i, %4,%5,%6
++%endif
+
+-cglobal %2_h264_qpel%4_%3_10_%1, %5,%6,%7
++cglobal %1_h264_qpel%3_%2_10, %4,%5,%6
+ %if UNIX64 == 0 ; no prologue or epilogue for UNIX64
+- call stub_%2_h264_qpel%4_%3_10_%1
++ call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
+ RET
+ %endif
+
+-stub_%2_h264_qpel%4_%3_10_%1:
++stub_%1_h264_qpel%3_%2_10 %+ SUFFIX:
+ %endmacro
+
+ ;-----------------------------------------------------------------------------
+@@ -189,14 +181,14 @@ stub_%2_h264_qpel%4_%3_10_%1:
+ %endmacro
+
+ %macro MC00 1
+-INIT_MMX
+-cglobal_mc mmxext, %1, mc00, 4, 3,4,0
++INIT_MMX mmxext
++cglobal_mc %1, mc00, 4, 3,4,0
+ lea r3, [r2*3]
+ COPY4
+ ret
+
+-INIT_XMM
+-cglobal %1_h264_qpel8_mc00_10_sse2, 3,4
++INIT_XMM sse2
++cglobal %1_h264_qpel8_mc00_10, 3,4
+ lea r3, [r2*3]
+ COPY4
+ lea r0, [r0+r2*4]
+@@ -204,7 +196,7 @@ cglobal %1_h264_qpel8_mc00_10_sse2, 3,4
+ COPY4
+ RET
+
+-cglobal %1_h264_qpel16_mc00_10_sse2, 3,4
++cglobal %1_h264_qpel16_mc00_10, 3,4
+ mov r3d, 8
+ .loop:
+ movu m0, [r1 ]
+@@ -234,28 +226,32 @@ MC00 avg
+ %macro MC_CACHE 1
+ %define OP_MOV mova
+ %define PALIGNR PALIGNR_MMX
+-INIT_MMX
+-%1 mmxext , put, 4
+-INIT_XMM
+-%1 sse2_cache64 , put, 8
++INIT_MMX mmxext
++%1 put, 4
++INIT_XMM sse2, cache64
++%1 put, 8
++INIT_XMM ssse3, cache64
+ %define PALIGNR PALIGNR_SSSE3
+-%1 ssse3_cache64, put, 8
+-%1 sse2 , put, 8, 0
++%1 put, 8
++INIT_XMM sse2
++%1 put, 8, 0
+
+ %define OP_MOV AVG_MOV
+ %define PALIGNR PALIGNR_MMX
+-INIT_MMX
+-%1 mmxext , avg, 4
+-INIT_XMM
+-%1 sse2_cache64 , avg, 8
++INIT_MMX mmxext
++%1 avg, 4
++INIT_XMM sse2, cache64
++%1 avg, 8
++INIT_XMM ssse3, cache64
+ %define PALIGNR PALIGNR_SSSE3
+-%1 ssse3_cache64, avg, 8
+-%1 sse2 , avg, 8, 0
++%1 avg, 8
++INIT_XMM sse2
++%1 avg, 8, 0
+ %endmacro
+
+-%macro MC20 3-4
+-cglobal_mc %1, %2, mc20, %3, 3,4,9
+- mov r3d, %3
++%macro MC20 2-3
++cglobal_mc %1, mc20, %2, 3,4,9
++ mov r3d, %2
+ mova m1, [pw_pixel_max]
+ %if num_mmregs > 8
+ mova m8, [pw_16]
+@@ -315,10 +311,10 @@ MC_CACHE MC20
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc30(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC30 3-4
+-cglobal_mc %1, %2, mc30, %3, 3,5,9
++%macro MC30 2-3
++cglobal_mc %1, mc30, %2, 3,5,9
+ lea r4, [r1+2]
+- jmp stub_%2_h264_qpel%3_mc10_10_%1.body
++ jmp stub_%1_h264_qpel%2_mc10_10 %+ SUFFIX %+ .body
+ %endmacro
+
+ MC_CACHE MC30
+@@ -326,11 +322,11 @@ MC_CACHE MC30
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc10(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC10 3-4
+-cglobal_mc %1, %2, mc10, %3, 3,5,9
++%macro MC10 2-3
++cglobal_mc %1, mc10, %2, 3,5,9
+ mov r4, r1
+ .body:
+- mov r3d, %3
++ mov r3d, %2
+ mova m1, [pw_pixel_max]
+ %if num_mmregs > 8
+ mova m8, [pw_16]
+@@ -393,8 +389,8 @@ MC_CACHE MC10
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc02(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro V_FILT 11
+-v_filt%9_%10_10_%11:
++%macro V_FILT 10
++v_filt%9_%10_10
+ add r4, r2
+ .no_addr4:
+ FILT_V m0, m1, m2, m3, m4, m5, m6, m7
+@@ -403,33 +399,33 @@ v_filt%9_%10_10_%11:
+ ret
+ %endmacro
+
+-INIT_MMX
++INIT_MMX mmxext
+ RESET_MM_PERMUTATION
+ %assign i 0
+ %rep 4
+-V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 4, i, mmxext
++V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 4, i
+ SWAP 0,1,2,3,4,5
+ %assign i i+1
+ %endrep
+
+-INIT_XMM
++INIT_XMM sse2
+ RESET_MM_PERMUTATION
+ %assign i 0
+ %rep 6
+-V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 8, i, sse2
++V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 8, i
+ SWAP 0,1,2,3,4,5
+ %assign i i+1
+ %endrep
+
+-%macro MC02 3
+-cglobal_mc %1, %2, mc02, %3, 3,4,8
++%macro MC02 2
++cglobal_mc %1, mc02, %2, 3,4,8
+ PRELOAD_V
+
+ sub r0, r2
+ %assign j 0
+-%rep %3
++%rep %2
+ %assign i (j % 6)
+- call v_filt%3_ %+ i %+ _10_%1.no_addr4
++ call v_filt%2_ %+ i %+ _10.no_addr4
+ OP_MOV [r0], m0
+ SWAP 0,1,2,3,4,5
+ %assign j j+1
+@@ -442,8 +438,8 @@ MC MC02
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc01(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC01 3
+-cglobal_mc %1, %2, mc01, %3, 3,5,8
++%macro MC01 2
++cglobal_mc %1, mc01, %2, 3,5,8
+ mov r4, r1
+ .body:
+ PRELOAD_V
+@@ -451,9 +447,9 @@ cglobal_mc %1, %2, mc01, %3, 3,5,8
+ sub r4, r2
+ sub r0, r2
+ %assign j 0
+-%rep %3
++%rep %2
+ %assign i (j % 6)
+- call v_filt%3_ %+ i %+ _10_%1
++ call v_filt%2_ %+ i %+ _10
+ movu m7, [r4]
+ pavgw m0, m7
+ OP_MOV [r0], m0
+@@ -468,10 +464,10 @@ MC MC01
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc03(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC03 3
+-cglobal_mc %1, %2, mc03, %3, 3,5,8
++%macro MC03 2
++cglobal_mc %1, mc03, %2, 3,5,8
+ lea r4, [r1+r2]
+- jmp stub_%2_h264_qpel%3_mc01_10_%1.body
++ jmp stub_%1_h264_qpel%2_mc01_10 %+ SUFFIX %+ .body
+ %endmacro
+
+ MC MC03
+@@ -479,8 +475,8 @@ MC MC03
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc11(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro H_FILT_AVG 3-4
+-h_filt%2_%3_10_%1:
++%macro H_FILT_AVG 2-3
++h_filt%1_%2_10:
+ ;FILT_H with fewer registers and averaged with the FILT_V result
+ ;m6,m7 are tmp registers, m0 is the FILT_V result, the rest are to be used next in the next iteration
+ ;unfortunately I need three registers, so m5 will have to be re-read from memory
+@@ -507,32 +503,32 @@ h_filt%2_%3_10_%1:
+ ret
+ %endmacro
+
+-INIT_MMX
++INIT_MMX mmxext
+ RESET_MM_PERMUTATION
+ %assign i 0
+ %rep 3
+-H_FILT_AVG mmxext, 4, i
++H_FILT_AVG 4, i
+ SWAP 0,1,2,3,4,5
+ %assign i i+1
+ %endrep
+-H_FILT_AVG mmxext, 4, i, 0
++H_FILT_AVG 4, i, 0
+
+-INIT_XMM
++INIT_XMM sse2
+ RESET_MM_PERMUTATION
+ %assign i 0
+ %rep 6
+ %if i==1
+-H_FILT_AVG sse2, 8, i, 0
++H_FILT_AVG 8, i, 0
+ %else
+-H_FILT_AVG sse2, 8, i
++H_FILT_AVG 8, i
+ %endif
+ SWAP 0,1,2,3,4,5
+ %assign i i+1
+ %endrep
+
+-%macro MC11 3
++%macro MC11 2
+ ; this REALLY needs x86_64
+-cglobal_mc %1, %2, mc11, %3, 3,6,8
++cglobal_mc %1, mc11, %2, 3,6,8
+ mov r4, r1
+ .body:
+ PRELOAD_V
+@@ -542,11 +538,11 @@ cglobal_mc %1, %2, mc11, %3, 3,6,8
+ mov r5, r2
+ neg r5
+ %assign j 0
+-%rep %3
++%rep %2
+ %assign i (j % 6)
+- call v_filt%3_ %+ i %+ _10_%1
+- call h_filt%3_ %+ i %+ _10_%1
+-%if %3==8 && i==1
++ call v_filt%2_ %+ i %+ _10
++ call h_filt%2_ %+ i %+ _10
++%if %2==8 && i==1
+ movu m5, [r1+r5]
+ %endif
+ OP_MOV [r0], m0
+@@ -561,11 +557,11 @@ MC MC11
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc31(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC31 3
+-cglobal_mc %1, %2, mc31, %3, 3,6,8
++%macro MC31 2
++cglobal_mc %1, mc31, %2, 3,6,8
+ mov r4, r1
+ add r1, 2
+- jmp stub_%2_h264_qpel%3_mc11_10_%1.body
++ jmp stub_%1_h264_qpel%2_mc11_10 %+ SUFFIX %+ .body
+ %endmacro
+
+ MC MC31
+@@ -573,10 +569,10 @@ MC MC31
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc13(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC13 3
+-cglobal_mc %1, %2, mc13, %3, 3,7,12
++%macro MC13 2
++cglobal_mc %1, mc13, %2, 3,7,12
+ lea r4, [r1+r2]
+- jmp stub_%2_h264_qpel%3_mc11_10_%1.body
++ jmp stub_%1_h264_qpel%2_mc11_10 %+ SUFFIX %+ .body
+ %endmacro
+
+ MC MC13
+@@ -584,11 +580,11 @@ MC MC13
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc33(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC33 3
+-cglobal_mc %1, %2, mc33, %3, 3,6,8
++%macro MC33 2
++cglobal_mc %1, mc33, %2, 3,6,8
+ lea r4, [r1+r2]
+ add r1, 2
+- jmp stub_%2_h264_qpel%3_mc11_10_%1.body
++ jmp stub_%1_h264_qpel%2_mc11_10 %+ SUFFIX %+ .body
+ %endmacro
+
+ MC MC33
+@@ -615,15 +611,15 @@ MC MC33
+ FILT_H2 %1, %7, %8
+ %endmacro
+
+-%macro HV 2
+-%ifidn %1,sse2
++%macro HV 1
++%if mmsize==16
+ %define PAD 12
+ %define COUNT 2
+ %else
+ %define PAD 4
+ %define COUNT 3
+ %endif
+-put_hv%2_10_%1:
++put_hv%1_10:
+ neg r2 ; This actually saves instructions
+ lea r1, [r1+r2*2-mmsize+PAD]
+ lea r4, [rsp+PAD+gprsize]
+@@ -640,7 +636,7 @@ put_hv%2_10_%1:
+ movu m4, [r1]
+ sub r1, r2
+ %assign i 0
+-%rep %2-1
++%rep %1-1
+ FILT_VNRD m0, m1, m2, m3, m4, m5, m6, m7
+ psubw m0, [pad20]
+ movu [r4+i*mmsize*3], m0
+@@ -653,7 +649,7 @@ put_hv%2_10_%1:
+ movu [r4+i*mmsize*3], m0
+ add r4, mmsize
+ lea r1, [r1+r2*8+mmsize]
+-%if %2==8
++%if %1==8
+ lea r1, [r1+r2*4]
+ %endif
+ dec r3d
+@@ -662,12 +658,12 @@ put_hv%2_10_%1:
+ ret
+ %endmacro
+
+-INIT_MMX
+-HV mmxext, 4
+-INIT_XMM
+-HV sse2 , 8
++INIT_MMX mmxext
++HV 4
++INIT_XMM sse2
++HV 8
+
+-%macro H_LOOP 2
++%macro H_LOOP 1
+ %if num_mmregs > 8
+ %define s1 m8
+ %define s2 m9
+@@ -679,7 +675,7 @@ HV sse2 , 8
+ %define s3 [tap3]
+ %define d1 [depad]
+ %endif
+-h%2_loop_op_%1:
++h%1_loop_op:
+ movu m1, [r1+mmsize-4]
+ movu m2, [r1+mmsize-2]
+ mova m3, [r1+mmsize+0]
+@@ -726,21 +722,21 @@ h%2_loop_op_%1:
+ ret
+ %endmacro
+
+-INIT_MMX
+-H_LOOP mmxext, 4
+-INIT_XMM
+-H_LOOP sse2 , 8
++INIT_MMX mmxext
++H_LOOP 4
++INIT_XMM sse2
++H_LOOP 8
+
+-%macro MC22 3
+-cglobal_mc %1, %2, mc22, %3, 3,7,12
++%macro MC22 2
++cglobal_mc %1, mc22, %2, 3,7,12
+ %define PAD mmsize*8*4*2 ; SIZE*16*4*sizeof(pixel)
+ mov r6, rsp ; backup stack pointer
+ and rsp, ~(mmsize-1) ; align stack
+ sub rsp, PAD
+
+- call put_hv%3_10_%1
++ call put_hv%2_10
+
+- mov r3d, %3
++ mov r3d, %2
+ mova m7, [pw_pixel_max]
+ %if num_mmregs > 8
+ pxor m0, m0
+@@ -751,7 +747,7 @@ cglobal_mc %1, %2, mc22, %3, 3,7,12
+ %endif
+ mov r1, rsp
+ .h_loop:
+- call h%3_loop_op_%1
++ call h%2_loop_op
+
+ OP_MOV [r0], m1
+ add r0, r2
+@@ -767,18 +763,18 @@ MC MC22
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc12(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC12 3
+-cglobal_mc %1, %2, mc12, %3, 3,7,12
++%macro MC12 2
++cglobal_mc %1, mc12, %2, 3,7,12
+ %define PAD mmsize*8*4*2 ; SIZE*16*4*sizeof(pixel)
+ mov r6, rsp ; backup stack pointer
+ and rsp, ~(mmsize-1) ; align stack
+ sub rsp, PAD
+
+- call put_hv%3_10_%1
++ call put_hv%2_10
+
+ xor r4d, r4d
+ .body:
+- mov r3d, %3
++ mov r3d, %2
+ pxor m0, m0
+ mova m7, [pw_pixel_max]
+ %if num_mmregs > 8
+@@ -789,7 +785,7 @@ cglobal_mc %1, %2, mc12, %3, 3,7,12
+ %endif
+ mov r1, rsp
+ .h_loop:
+- call h%3_loop_op_%1
++ call h%2_loop_op
+
+ movu m3, [r1+r4-2*mmsize] ; movu needed for mc32, etc
+ paddw m3, [depad2]
+@@ -812,17 +808,17 @@ MC MC12
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc32(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC32 3
+-cglobal_mc %1, %2, mc32, %3, 3,7,12
++%macro MC32 2
++cglobal_mc %1, mc32, %2, 3,7,12
+ %define PAD mmsize*8*3*2 ; SIZE*16*4*sizeof(pixel)
+ mov r6, rsp ; backup stack pointer
+ and rsp, ~(mmsize-1) ; align stack
+ sub rsp, PAD
+
+- call put_hv%3_10_%1
++ call put_hv%2_10
+
+ mov r4d, 2 ; sizeof(pixel)
+- jmp stub_%2_h264_qpel%3_mc12_10_%1.body
++ jmp stub_%1_h264_qpel%2_mc12_10 %+ SUFFIX %+ .body
+ %endmacro
+
+ MC MC32
+@@ -830,10 +826,10 @@ MC MC32
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc21(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro H_NRD 2
+-put_h%2_10_%1:
++%macro H_NRD 1
++put_h%1_10:
+ add rsp, gprsize
+- mov r3d, %2
++ mov r3d, %1
+ xor r4d, r4d
+ mova m6, [pad20]
+ .nextrow:
+@@ -855,13 +851,13 @@ put_h%2_10_%1:
+ ret
+ %endmacro
+
+-INIT_MMX
+-H_NRD mmxext, 4
+-INIT_XMM
+-H_NRD sse2 , 8
++INIT_MMX mmxext
++H_NRD 4
++INIT_XMM sse2
++H_NRD 8
+
+-%macro MC21 3
+-cglobal_mc %1, %2, mc21, %3, 3,7,12
++%macro MC21 2
++cglobal_mc %1, mc21, %2, 3,7,12
+ mov r5, r1
+ .body:
+ %define PAD mmsize*8*3*2 ; SIZE*16*4*sizeof(pixel)
+@@ -869,13 +865,13 @@ cglobal_mc %1, %2, mc21, %3, 3,7,12
+ and rsp, ~(mmsize-1) ; align stack
+
+ sub rsp, PAD
+- call put_h%3_10_%1
++ call put_h%2_10
+
+ sub rsp, PAD
+- call put_hv%3_10_%1
++ call put_hv%2_10
+
+ mov r4d, PAD-mmsize ; H buffer
+- jmp stub_%2_h264_qpel%3_mc12_10_%1.body
++ jmp stub_%1_h264_qpel%2_mc12_10 %+ SUFFIX %+ .body
+ %endmacro
+
+ MC MC21
+@@ -883,10 +879,10 @@ MC MC21
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc23(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC23 3
+-cglobal_mc %1, %2, mc23, %3, 3,7,12
++%macro MC23 2
++cglobal_mc %1, mc23, %2, 3,7,12
+ lea r5, [r1+r2]
+- jmp stub_%2_h264_qpel%3_mc21_10_%1.body
++ jmp stub_%1_h264_qpel%2_mc21_10 %+ SUFFIX %+ .body
+ %endmacro
+
+ MC MC23
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0198-x86-PALIGNR-port-to-cpuflags.patch b/debian/patches/post-9beta2/0198-x86-PALIGNR-port-to-cpuflags.patch
new file mode 100644
index 0000000..294b7bc
--- /dev/null
+++ b/debian/patches/post-9beta2/0198-x86-PALIGNR-port-to-cpuflags.patch
@@ -0,0 +1,409 @@
+From 4b60fac4199680957b15b7a08c5df47e47c6e25e Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sun, 8 Jul 2012 01:30:30 +0200
+Subject: [PATCH 198/204] x86: PALIGNR: port to cpuflags
+
+---
+ libavcodec/x86/h264_intrapred.asm | 27 ---------------------------
+ libavcodec/x86/h264_intrapred_10bit.asm | 16 ----------------
+ libavcodec/x86/h264_qpel_10bit.asm | 4 ----
+ libavresample/x86/audio_convert.asm | 6 ------
+ libavutil/x86/x86util.asm | 16 ++++++++--------
+ libswscale/x86/output.asm | 4 +---
+ 6 files changed, 9 insertions(+), 64 deletions(-)
+
+diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
+index dc3d475..8faaaf4 100644
+--- a/libavcodec/x86/h264_intrapred.asm
++++ b/libavcodec/x86/h264_intrapred.asm
+@@ -1063,10 +1063,8 @@ cglobal pred8x8l_top_dc_8, 4,4
+ %endmacro
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_TOP_DC
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_TOP_DC
+
+ ;-----------------------------------------------------------------------------
+@@ -1168,10 +1166,8 @@ cglobal pred8x8l_dc_8, 4,5
+ %endmacro
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_DC
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_DC
+
+ ;-----------------------------------------------------------------------------
+@@ -1241,10 +1237,8 @@ cglobal pred8x8l_horizontal_8, 4,4
+ %endmacro
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_HORIZONTAL
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_HORIZONTAL
+
+ ;-----------------------------------------------------------------------------
+@@ -1293,10 +1287,8 @@ cglobal pred8x8l_vertical_8, 4,4
+ %endmacro
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_VERTICAL
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_VERTICAL
+
+ ;-----------------------------------------------------------------------------
+@@ -1304,7 +1296,6 @@ PRED8x8L_VERTICAL
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ cglobal pred8x8l_down_left_8, 4,5
+ sub r0, r3
+ movq mm0, [r0-8]
+@@ -1496,10 +1487,8 @@ INIT_XMM cpuname
+ %endmacro
+
+ INIT_MMX sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_DOWN_LEFT
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_DOWN_LEFT
+
+ ;-----------------------------------------------------------------------------
+@@ -1507,7 +1496,6 @@ PRED8x8L_DOWN_LEFT
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ cglobal pred8x8l_down_right_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+@@ -1750,10 +1738,8 @@ INIT_XMM cpuname
+ %endmacro
+
+ INIT_MMX sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_DOWN_RIGHT
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_DOWN_RIGHT
+
+ ;-----------------------------------------------------------------------------
+@@ -1761,7 +1747,6 @@ PRED8x8L_DOWN_RIGHT
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ cglobal pred8x8l_vertical_right_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+@@ -1980,10 +1965,8 @@ INIT_XMM cpuname
+ %endmacro
+
+ INIT_MMX sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_VERTICAL_RIGHT
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_VERTICAL_RIGHT
+
+ ;-----------------------------------------------------------------------------
+@@ -2071,10 +2054,8 @@ INIT_XMM cpuname
+ %endmacro
+
+ INIT_MMX sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_VERTICAL_LEFT
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_VERTICAL_LEFT
+
+ ;-----------------------------------------------------------------------------
+@@ -2160,10 +2141,8 @@ cglobal pred8x8l_horizontal_up_8, 4,4
+ %endmacro
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_HORIZONTAL_UP
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_HORIZONTAL_UP
+
+ ;-----------------------------------------------------------------------------
+@@ -2171,7 +2150,6 @@ PRED8x8L_HORIZONTAL_UP
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ cglobal pred8x8l_horizontal_down_8, 4,5
+ sub r0, r3
+ lea r4, [r0+r3*2]
+@@ -2411,10 +2389,8 @@ INIT_XMM cpuname
+ %endmacro
+
+ INIT_MMX sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_HORIZONTAL_DOWN
+ INIT_MMX ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_HORIZONTAL_DOWN
+
+ ;-----------------------------------------------------------------------------
+@@ -2637,7 +2613,6 @@ cglobal pred4x4_horizontal_up_8, 3,3
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ cglobal pred4x4_horizontal_down_8, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+@@ -2673,7 +2648,6 @@ cglobal pred4x4_horizontal_down_8, 3,3
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ cglobal pred4x4_vertical_right_8, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+@@ -2704,7 +2678,6 @@ cglobal pred4x4_vertical_right_8, 3,3
+ ;-----------------------------------------------------------------------------
+
+ INIT_MMX mmxext
+-%define PALIGNR PALIGNR_MMX
+ cglobal pred4x4_down_right_8, 3,3
+ sub r0, r2
+ lea r1, [r0+r2*2]
+diff --git a/libavcodec/x86/h264_intrapred_10bit.asm b/libavcodec/x86/h264_intrapred_10bit.asm
+index 50ebaa7..039af6d 100644
+--- a/libavcodec/x86/h264_intrapred_10bit.asm
++++ b/libavcodec/x86/h264_intrapred_10bit.asm
+@@ -79,10 +79,8 @@ cglobal pred4x4_down_right_10, 3, 3
+ %endmacro
+
+ INIT_XMM sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED4x4_DR
+ INIT_XMM ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED4x4_DR
+ %if HAVE_AVX_EXTERNAL
+ INIT_XMM avx
+@@ -120,10 +118,8 @@ cglobal pred4x4_vertical_right_10, 3, 3, 6
+ %endmacro
+
+ INIT_XMM sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED4x4_VR
+ INIT_XMM ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED4x4_VR
+ %if HAVE_AVX_EXTERNAL
+ INIT_XMM avx
+@@ -164,10 +160,8 @@ cglobal pred4x4_horizontal_down_10, 3, 3
+ %endmacro
+
+ INIT_XMM sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED4x4_HD
+ INIT_XMM ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED4x4_HD
+ %if HAVE_AVX_EXTERNAL
+ INIT_XMM avx
+@@ -726,10 +720,8 @@ cglobal pred8x8l_horizontal_10, 4, 4, 5
+ %endmacro
+
+ INIT_XMM sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_HORIZONTAL
+ INIT_XMM ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_HORIZONTAL
+ %if HAVE_AVX_EXTERNAL
+ INIT_XMM avx
+@@ -796,10 +788,8 @@ cglobal pred8x8l_down_left_10, 4, 4, 7
+ %endmacro
+
+ INIT_XMM sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_DOWN_LEFT
+ INIT_XMM ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_DOWN_LEFT
+ %if HAVE_AVX_EXTERNAL
+ INIT_XMM avx
+@@ -872,10 +862,8 @@ cglobal pred8x8l_down_right_10, 4, 5, 8
+ %endmacro
+
+ INIT_XMM sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_DOWN_RIGHT
+ INIT_XMM ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_DOWN_RIGHT
+ %if HAVE_AVX_EXTERNAL
+ INIT_XMM avx
+@@ -944,10 +932,8 @@ cglobal pred8x8l_vertical_right_10, 4, 5, 7
+ %endmacro
+
+ INIT_XMM sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_VERTICAL_RIGHT
+ INIT_XMM ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_VERTICAL_RIGHT
+ %if HAVE_AVX_EXTERNAL
+ INIT_XMM avx
+@@ -1007,10 +993,8 @@ cglobal pred8x8l_horizontal_up_10, 4, 4, 6
+ %endmacro
+
+ INIT_XMM sse2
+-%define PALIGNR PALIGNR_MMX
+ PRED8x8L_HORIZONTAL_UP
+ INIT_XMM ssse3
+-%define PALIGNR PALIGNR_SSSE3
+ PRED8x8L_HORIZONTAL_UP
+ %if HAVE_AVX_EXTERNAL
+ INIT_XMM avx
+diff --git a/libavcodec/x86/h264_qpel_10bit.asm b/libavcodec/x86/h264_qpel_10bit.asm
+index 4aea032..c05c7a6 100644
+--- a/libavcodec/x86/h264_qpel_10bit.asm
++++ b/libavcodec/x86/h264_qpel_10bit.asm
+@@ -225,25 +225,21 @@ MC00 avg
+ ;-----------------------------------------------------------------------------
+ %macro MC_CACHE 1
+ %define OP_MOV mova
+-%define PALIGNR PALIGNR_MMX
+ INIT_MMX mmxext
+ %1 put, 4
+ INIT_XMM sse2, cache64
+ %1 put, 8
+ INIT_XMM ssse3, cache64
+-%define PALIGNR PALIGNR_SSSE3
+ %1 put, 8
+ INIT_XMM sse2
+ %1 put, 8, 0
+
+ %define OP_MOV AVG_MOV
+-%define PALIGNR PALIGNR_MMX
+ INIT_MMX mmxext
+ %1 avg, 4
+ INIT_XMM sse2, cache64
+ %1 avg, 8
+ INIT_XMM ssse3, cache64
+-%define PALIGNR PALIGNR_SSSE3
+ %1 avg, 8
+ INIT_XMM sse2
+ %1 avg, 8, 0
+diff --git a/libavresample/x86/audio_convert.asm b/libavresample/x86/audio_convert.asm
+index 567a916..1d125c2 100644
+--- a/libavresample/x86/audio_convert.asm
++++ b/libavresample/x86/audio_convert.asm
+@@ -919,10 +919,8 @@ cglobal conv_s16_to_s16p_6ch, 2,7,5, dst, src, dst1, dst2, dst3, dst4, dst5
+ REP_RET
+ %endmacro
+
+-%define PALIGNR PALIGNR_MMX
+ INIT_XMM sse2
+ CONV_S16_TO_S16P_6CH
+-%define PALIGNR PALIGNR_SSSE3
+ INIT_XMM ssse3
+ CONV_S16_TO_S16P_6CH
+ %if HAVE_AVX_EXTERNAL
+@@ -1038,10 +1036,8 @@ cglobal conv_s16_to_fltp_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
+ REP_RET
+ %endmacro
+
+-%define PALIGNR PALIGNR_MMX
+ INIT_XMM sse2
+ CONV_S16_TO_FLTP_6CH
+-%define PALIGNR PALIGNR_SSSE3
+ INIT_XMM ssse3
+ CONV_S16_TO_FLTP_6CH
+ INIT_XMM sse4
+@@ -1160,10 +1156,8 @@ cglobal conv_flt_to_s16p_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
+ REP_RET
+ %endmacro
+
+-%define PALIGNR PALIGNR_MMX
+ INIT_XMM sse2
+ CONV_FLT_TO_S16P_6CH
+-%define PALIGNR PALIGNR_SSSE3
+ INIT_XMM ssse3
+ CONV_FLT_TO_S16P_6CH
+ %if HAVE_AVX_EXTERNAL
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index b35d594..31163ee 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -280,7 +280,14 @@
+ %endif
+ %endmacro
+
+-%macro PALIGNR_MMX 4-5 ; [dst,] src1, src2, imm, tmp
++%macro PALIGNR 4-5
++%if cpuflag(ssse3)
++%if %0==5
++ palignr %1, %2, %3, %4
++%else
++ palignr %1, %2, %3
++%endif
++%elif cpuflag(mmx) ; [dst,] src1, src2, imm, tmp
+ %define %%dst %1
+ %if %0==5
+ %ifnidn %1, %2
+@@ -299,13 +306,6 @@
+ psrldq %4, %3
+ %endif
+ por %%dst, %4
+-%endmacro
+-
+-%macro PALIGNR_SSSE3 4-5
+-%if %0==5
+- palignr %1, %2, %3, %4
+-%else
+- palignr %1, %2, %3
+ %endif
+ %endmacro
+
+diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
+index cf0dec3..23508b8 100644
+--- a/libswscale/x86/output.asm
++++ b/libswscale/x86/output.asm
+@@ -246,7 +246,6 @@ cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset
+ %endif ; %1 == 8/9/10/16
+ %endmacro
+
+-%define PALIGNR PALIGNR_MMX
+ %if ARCH_X86_32
+ INIT_MMX mmx2
+ yuv2planeX_fn 8, 0, 7
+@@ -259,7 +258,6 @@ yuv2planeX_fn 8, 10, 7
+ yuv2planeX_fn 9, 7, 5
+ yuv2planeX_fn 10, 7, 5
+
+-%define PALIGNR PALIGNR_SSSE3
+ INIT_XMM sse4
+ yuv2planeX_fn 8, 10, 7
+ yuv2planeX_fn 9, 7, 5
+@@ -344,7 +342,7 @@ cglobal yuv2plane1_%1, %3, %3, %2, src, dst, w, dither, offset
+ %if mmsize == 16
+ punpcklqdq m3, m3
+ %endif ; mmsize == 16
+- PALIGNR_MMX m3, m3, 3, m2
++ PALIGNR m3, m3, 3, m2
+ .no_rot:
+ %if mmsize == 8
+ mova m2, m3
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0199-x86-h264_qpel_10bit-drop-unused-parameter-from-MC10-.patch b/debian/patches/post-9beta2/0199-x86-h264_qpel_10bit-drop-unused-parameter-from-MC10-.patch
new file mode 100644
index 0000000..bb64950
--- /dev/null
+++ b/debian/patches/post-9beta2/0199-x86-h264_qpel_10bit-drop-unused-parameter-from-MC10-.patch
@@ -0,0 +1,57 @@
+From 6cd796049dc06eabe1a9714290713bd31024af9e Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Sat, 28 Jul 2012 04:02:09 +0200
+Subject: [PATCH 199/204] x86: h264_qpel_10bit: drop unused parameter from
+ MC10/MC20/MC30 macros
+
+---
+ libavcodec/x86/h264_qpel_10bit.asm | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/libavcodec/x86/h264_qpel_10bit.asm b/libavcodec/x86/h264_qpel_10bit.asm
+index c05c7a6..e14df84 100644
+--- a/libavcodec/x86/h264_qpel_10bit.asm
++++ b/libavcodec/x86/h264_qpel_10bit.asm
+@@ -232,7 +232,7 @@ INIT_XMM sse2, cache64
+ INIT_XMM ssse3, cache64
+ %1 put, 8
+ INIT_XMM sse2
+-%1 put, 8, 0
++%1 put, 8
+
+ %define OP_MOV AVG_MOV
+ INIT_MMX mmxext
+@@ -242,10 +242,10 @@ INIT_XMM sse2, cache64
+ INIT_XMM ssse3, cache64
+ %1 avg, 8
+ INIT_XMM sse2
+-%1 avg, 8, 0
++%1 avg, 8
+ %endmacro
+
+-%macro MC20 2-3
++%macro MC20 2
+ cglobal_mc %1, mc20, %2, 3,4,9
+ mov r3d, %2
+ mova m1, [pw_pixel_max]
+@@ -307,7 +307,7 @@ MC_CACHE MC20
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc30(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC30 2-3
++%macro MC30 2
+ cglobal_mc %1, mc30, %2, 3,5,9
+ lea r4, [r1+2]
+ jmp stub_%1_h264_qpel%2_mc10_10 %+ SUFFIX %+ .body
+@@ -318,7 +318,7 @@ MC_CACHE MC30
+ ;-----------------------------------------------------------------------------
+ ; void h264_qpel_mc10(uint8_t *dst, uint8_t *src, int stride)
+ ;-----------------------------------------------------------------------------
+-%macro MC10 2-3
++%macro MC10 2
+ cglobal_mc %1, mc10, %2, 3,5,9
+ mov r4, r1
+ .body:
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0200-x86inc-Set-program_name-outside-of-x86inc.asm.patch b/debian/patches/post-9beta2/0200-x86inc-Set-program_name-outside-of-x86inc.asm.patch
new file mode 100644
index 0000000..c405f0c
--- /dev/null
+++ b/debian/patches/post-9beta2/0200-x86inc-Set-program_name-outside-of-x86inc.asm.patch
@@ -0,0 +1,39 @@
+From f0d124f005ff02dba56b09fdd5fe2a9ba961f650 Mon Sep 17 00:00:00 2001
+From: Diego Biurrun <diego at biurrun.de>
+Date: Tue, 30 Oct 2012 03:21:48 +0100
+Subject: [PATCH 200/204] x86inc: Set program_name outside of x86inc.asm
+
+This reduces the local difference to the x264 upstream version.
+---
+ libavutil/x86/x86inc.asm | 2 +-
+ libavutil/x86/x86util.asm | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
+index b0df2b2..52ee46a 100644
+--- a/libavutil/x86/x86inc.asm
++++ b/libavutil/x86/x86inc.asm
+@@ -35,7 +35,7 @@
+ ; to x264-devel at videolan.org .
+
+ %ifndef program_name
+- %define program_name ff
++ %define program_name x264
+ %endif
+
+ %define WIN64 0
+diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
+index 31163ee..cf11183 100644
+--- a/libavutil/x86/x86util.asm
++++ b/libavutil/x86/x86util.asm
+@@ -23,6 +23,7 @@
+ ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ ;******************************************************************************
+
++%define program_name ff
+ %define cpuflags_mmxext cpuflags_mmx2
+
+ %include "libavutil/x86/x86inc.asm"
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0201-configure-add-lavu-dependency-to-lavr-lavfi-.pc-file.patch b/debian/patches/post-9beta2/0201-configure-add-lavu-dependency-to-lavr-lavfi-.pc-file.patch
new file mode 100644
index 0000000..4c7b9aa
--- /dev/null
+++ b/debian/patches/post-9beta2/0201-configure-add-lavu-dependency-to-lavr-lavfi-.pc-file.patch
@@ -0,0 +1,26 @@
+From e5e1a06e443f4994cdeff39e99f67ce2c518ed2a Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Sat, 3 Nov 2012 08:14:11 +0100
+Subject: [PATCH 201/204] configure: add lavu dependency to lavr/lavfi .pc
+ files
+
+---
+ configure | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 515a3c9..d67fc85 100755
+--- a/configure
++++ b/configure
+@@ -3903,6 +3903,6 @@ pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION" "$LIBM
+ pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
+ pkgconfig_generate libavformat "Libav container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
+ pkgconfig_generate libavdevice "Libav device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
+-pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
+-pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
++pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
++pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
+ pkgconfig_generate libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0202-mss2-fix-handling-of-unmasked-implicit-WMV9-rectangl.patch b/debian/patches/post-9beta2/0202-mss2-fix-handling-of-unmasked-implicit-WMV9-rectangl.patch
new file mode 100644
index 0000000..c3af2b0
--- /dev/null
+++ b/debian/patches/post-9beta2/0202-mss2-fix-handling-of-unmasked-implicit-WMV9-rectangl.patch
@@ -0,0 +1,69 @@
+From b077eb07805dc5d139b2f118ddb122cc9df8b87a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alberto=20Delm=C3=A1s?= <adelmas at gmail.com>
+Date: Sun, 11 Nov 2012 09:23:06 +0100
+Subject: [PATCH 202/204] mss2: fix handling of unmasked implicit WMV9
+ rectangles
+
+Signed-off-by: Kostya Shishkov <kostya.shishkov at gmail.com>
+---
+ libavcodec/mss2.c | 23 +++++++++++++----------
+ 1 file changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
+index 597ebb6..ceeff5a 100644
+--- a/libavcodec/mss2.c
++++ b/libavcodec/mss2.c
+@@ -474,7 +474,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ int keyframe, has_wmv9, has_mv, is_rle, is_555, ret;
+
+ Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
+- int used_rects = 0, i, implicit_rect, av_uninit(wmv9_mask);
++ int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
+
+ av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
+ ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
+@@ -650,7 +650,14 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ return AVERROR_INVALIDDATA;
+
+ buf_size -= bytestream2_tell(&gB);
+- } else if (is_rle) {
++ } else {
++ if (keyframe) {
++ c->corrupted = 0;
++ ff_mss12_slicecontext_reset(&ctx->sc[0]);
++ if (c->slice_split)
++ ff_mss12_slicecontext_reset(&ctx->sc[1]);
++ }
++ if (is_rle) {
+ init_get_bits(&gb, buf, buf_size * 8);
+ if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
+ c->rgb_pic, c->rgb_stride, c->pal, keyframe,
+@@ -669,14 +676,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ align_get_bits(&gb);
+ buf += get_bits_count(&gb) >> 3;
+ buf_size -= get_bits_count(&gb) >> 3;
+- } else {
+- if (keyframe) {
+- c->corrupted = 0;
+- ff_mss12_slicecontext_reset(&ctx->sc[0]);
+- if (c->slice_split)
+- ff_mss12_slicecontext_reset(&ctx->sc[1]);
+- }
+- else if (c->corrupted)
++ } else if (!implicit_rect || wmv9_mask != -1) {
++ if (c->corrupted)
+ return AVERROR_INVALIDDATA;
+ bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
+ arith2_init(&acoder, &gB);
+@@ -702,6 +703,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ buf += arith2_get_consumed_bytes(&acoder);
+ buf_size -= arith2_get_consumed_bytes(&acoder);
+ }
++ } else
++ memset(c->pal_pic, 0, c->pal_stride * avctx->height);
+ }
+
+ if (has_wmv9) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0203-mss2-reindent-after-last-commit.patch b/debian/patches/post-9beta2/0203-mss2-reindent-after-last-commit.patch
new file mode 100644
index 0000000..24a2d34
--- /dev/null
+++ b/debian/patches/post-9beta2/0203-mss2-reindent-after-last-commit.patch
@@ -0,0 +1,105 @@
+From 6d93308c0ca3783b3278aef8e6e64d8f0558f319 Mon Sep 17 00:00:00 2001
+From: Kostya Shishkov <kostya.shishkov at gmail.com>
+Date: Sun, 11 Nov 2012 15:00:38 +0100
+Subject: [PATCH 203/204] mss2: reindent after last commit
+
+---
+ libavcodec/mss2.c | 68 ++++++++++++++++++++++++++---------------------------
+ 1 file changed, 34 insertions(+), 34 deletions(-)
+
+diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
+index ceeff5a..5f99b7a 100644
+--- a/libavcodec/mss2.c
++++ b/libavcodec/mss2.c
+@@ -657,54 +657,54 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ if (c->slice_split)
+ ff_mss12_slicecontext_reset(&ctx->sc[1]);
+ }
+- if (is_rle) {
+- init_get_bits(&gb, buf, buf_size * 8);
+- if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
+- c->rgb_pic, c->rgb_stride, c->pal, keyframe,
+- ctx->split_position, 0,
+- avctx->width, avctx->height))
+- return ret;
+- align_get_bits(&gb);
+-
+- if (c->slice_split)
++ if (is_rle) {
++ init_get_bits(&gb, buf, buf_size * 8);
+ if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
+ c->rgb_pic, c->rgb_stride, c->pal, keyframe,
+- ctx->split_position, 1,
++ ctx->split_position, 0,
+ avctx->width, avctx->height))
+ return ret;
++ align_get_bits(&gb);
+
+- align_get_bits(&gb);
+- buf += get_bits_count(&gb) >> 3;
+- buf_size -= get_bits_count(&gb) >> 3;
+- } else if (!implicit_rect || wmv9_mask != -1) {
+- if (c->corrupted)
+- return AVERROR_INVALIDDATA;
+- bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
+- arith2_init(&acoder, &gB);
+- c->keyframe = keyframe;
+- if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, 0,
+- avctx->width,
+- ctx->split_position))
+- return AVERROR_INVALIDDATA;
++ if (c->slice_split)
++ if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
++ c->rgb_pic, c->rgb_stride, c->pal, keyframe,
++ ctx->split_position, 1,
++ avctx->width, avctx->height))
++ return ret;
+
+- buf += arith2_get_consumed_bytes(&acoder);
+- buf_size -= arith2_get_consumed_bytes(&acoder);
+- if (c->slice_split) {
+- if (buf_size < 1)
++ align_get_bits(&gb);
++ buf += get_bits_count(&gb) >> 3;
++ buf_size -= get_bits_count(&gb) >> 3;
++ } else if (!implicit_rect || wmv9_mask != -1) {
++ if (c->corrupted)
+ return AVERROR_INVALIDDATA;
+ bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
+ arith2_init(&acoder, &gB);
+- if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[1], &acoder, 0,
+- ctx->split_position,
++ c->keyframe = keyframe;
++ if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, 0,
+ avctx->width,
+- avctx->height - ctx->split_position))
++ ctx->split_position))
+ return AVERROR_INVALIDDATA;
+
+ buf += arith2_get_consumed_bytes(&acoder);
+ buf_size -= arith2_get_consumed_bytes(&acoder);
+- }
+- } else
+- memset(c->pal_pic, 0, c->pal_stride * avctx->height);
++ if (c->slice_split) {
++ if (buf_size < 1)
++ return AVERROR_INVALIDDATA;
++ bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
++ arith2_init(&acoder, &gB);
++ if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[1], &acoder, 0,
++ ctx->split_position,
++ avctx->width,
++ avctx->height - ctx->split_position))
++ return AVERROR_INVALIDDATA;
++
++ buf += arith2_get_consumed_bytes(&acoder);
++ buf_size -= arith2_get_consumed_bytes(&acoder);
++ }
++ } else
++ memset(c->pal_pic, 0, c->pal_stride * avctx->height);
+ }
+
+ if (has_wmv9) {
+--
+1.7.9.5
+
diff --git a/debian/patches/post-9beta2/0204-mss2-prevent-potential-uninitialized-reads.patch b/debian/patches/post-9beta2/0204-mss2-prevent-potential-uninitialized-reads.patch
new file mode 100644
index 0000000..ac693da
--- /dev/null
+++ b/debian/patches/post-9beta2/0204-mss2-prevent-potential-uninitialized-reads.patch
@@ -0,0 +1,32 @@
+From 802713c4e7b41bc2deed754d78649945c3442063 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alberto=20Delm=C3=A1s?= <adelmas at gmail.com>
+Date: Sun, 11 Nov 2012 09:47:39 +0100
+Subject: [PATCH 204/204] mss2: prevent potential uninitialized reads
+
+The alternative to zeroing on init is setting the corrupted flag in
+all cases where pal_pic is not fully written, at the cost of added
+complexity.
+
+Signed-off-by: Kostya Shishkov <kostya.shishkov at gmail.com>
+---
+ libavcodec/mss2.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
+index 5f99b7a..bec3f45 100644
+--- a/libavcodec/mss2.c
++++ b/libavcodec/mss2.c
+@@ -839,8 +839,8 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx)
+ if (ret = ff_mss12_decode_init(c, 1, &ctx->sc[0], &ctx->sc[1]))
+ return ret;
+ c->pal_stride = c->mask_stride;
+- c->pal_pic = av_malloc(c->pal_stride * avctx->height);
+- c->last_pal_pic = av_malloc(c->pal_stride * avctx->height);
++ c->pal_pic = av_mallocz(c->pal_stride * avctx->height);
++ c->last_pal_pic = av_mallocz(c->pal_stride * avctx->height);
+ if (!c->pal_pic || !c->last_pal_pic) {
+ mss2_decode_end(avctx);
+ return AVERROR(ENOMEM);
+--
+1.7.9.5
+
diff --git a/debian/patches/series b/debian/patches/series
index 8e1e269..70e61dc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,208 @@
01-Tweak-doxygen-config.patch
03-disable-configuration-warnings.patch
+
+# post-9beta2 patches to sync ot current master
+post-9beta2/0001-lzo-Use-AV_COPY-U-macros-where-appropriate.patch
+post-9beta2/0002-Remove-need-for-padding-in-av_memcpy_backptr.patch
+post-9beta2/0003-av_memcpy_backptr-Drop-no-longer-necessary-malloc-pa.patch
+post-9beta2/0004-dfa-use-av_memcpy_backptr-where-previously-impossibl.patch
+post-9beta2/0005-doxygen-Build-Doxygen-documentation-in-the-doc-subdi.patch
+post-9beta2/0006-Move-Doxyfile-into-the-doc-subdirectory.patch
+post-9beta2/0007-lavc-use-the-correct-API-version-guard-macro-for-avc.patch
+post-9beta2/0008-atrac3-return-an-error-if-extradata_size-is-not-a-sp.patch
+post-9beta2/0009-lavc-fix-documentation-for-AVCodecContext.delay.patch
+post-9beta2/0010-lavc-initialize-output-AVFrame-before-decoding.patch
+post-9beta2/0011-avconv-remove-now-unneeded-calls-to-avcodec_get_fram.patch
+post-9beta2/0012-g.723.1-add-missing-CODEC_CAP_DR1.patch
+post-9beta2/0013-asfdec-cosmetics-reformat-ff_asf_parse_packet.patch
+post-9beta2/0014-smoothstreamingenc-Don-t-assume-streams-start-from-t.patch
+post-9beta2/0015-configure-generalise-64-bit-test.patch
+post-9beta2/0016-configure-detect-mips64-automatically.patch
+post-9beta2/0017-configure-detect-ppc64-automatically.patch
+post-9beta2/0018-configure-detect-parisc64-automatically.patch
+post-9beta2/0019-avutil-Move-memcpy_backptr-to-mem.c.patch
+post-9beta2/0020-avutil-Make-LZO-decoder-code-configure-time-selectab.patch
+post-9beta2/0021-rawvideo-use-a-specific-read_header.patch
+post-9beta2/0022-g722-refactor-out-of-rawdec.c.patch
+post-9beta2/0023-pcmdec-remove-dependency-from-rawdec.patch
+post-9beta2/0024-rawdec-remove-ff_raw_read_header.patch
+post-9beta2/0025-avfilter-fix-graphparser-memleaks-on-error-paths.patch
+post-9beta2/0026-avconv-fix-bitrate-report-when-writing-to-dev-null.patch
+post-9beta2/0027-pcmdec-change-default-of-channels-parameter-to-1.patch
+post-9beta2/0028-ffv1-set-the-range-coder-state-in-decode_slice_heade.patch
+post-9beta2/0029-pcm-change-references-to-raw-to-pcm.patch
+post-9beta2/0030-build-Include-HEADERS-yes-in-the-HEADERS-variable.patch
+post-9beta2/0031-configure-recognise-more-sparc-variants-as-cpu-argum.patch
+post-9beta2/0032-configure-sanitise-sparc-vis-check.patch
+post-9beta2/0033-h263-avoid-memcpys-over-array-bound-in-motion-vector.patch
+post-9beta2/0034-doxygen-Drop-some-pointless-entries-from-PREDEFINED-.patch
+post-9beta2/0035-doxygen-Add-av_alloc_size-to-list-of-predefined-macr.patch
+post-9beta2/0036-cook-cosmetics-Better-name-for-ccpl-COOKSubpacket-me.patch
+post-9beta2/0037-cook-cosmetics-Better-names-for-joint_decode-functio.patch
+post-9beta2/0038-cook-Remove-senseless-maybe_reformat_buffer32-functi.patch
+post-9beta2/0039-cook-Remove-some-silly-Doxygen-comments.patch
+post-9beta2/0040-ivi_common-Drop-unused-function-parameter-from-decod.patch
+post-9beta2/0041-doc-git-howto-Clarify-comment-about-pushing-series-o.patch
+post-9beta2/0042-configure-fix-tests-for-2-arg-math-functions.patch
+post-9beta2/0043-buffersink-remove-stray-semicolon-after-function-def.patch
+post-9beta2/0044-af_channelmap-remove-stray-enum-declaration.patch
+post-9beta2/0045-network-use-HAVE_THREADS-instead-of-local-hack.patch
+post-9beta2/0046-udp-use-socklen_t-where-appropriate.patch
+post-9beta2/0047-avserver-use-socklen_t-where-appropriate.patch
+post-9beta2/0048-avio-fix-pointer-type-mismatches-in-avio_enum_protoc.patch
+post-9beta2/0049-amrwbdec-fix-invalid-pointer-arithmetic.patch
+post-9beta2/0050-h264-fix-invalid-pointer-arithmetic.patch
+post-9beta2/0051-vp8-fix-memset-crossing-array-boundary.patch
+post-9beta2/0052-configure-detect-sparc64-automatically.patch
+post-9beta2/0053-assdec-fix-qsort-callback-signature.patch
+post-9beta2/0054-nutenc-K-R-formatting-cosmetics.patch
+post-9beta2/0055-yuv4mpeg-reject-unsupported-codecs.patch
+post-9beta2/0056-rtpdec-Cosmetic-cleanup.patch
+post-9beta2/0057-lavc-add-CODEC_CAP_DR1-to-all-video-decoders-missing.patch
+post-9beta2/0058-nutenc-verbosely-report-unsupported-negative-pts.patch
+post-9beta2/0059-nut-support-textual-data.patch
+post-9beta2/0060-rtsp-Avoid-a-cast-when-calling-strtol.patch
+post-9beta2/0061-aacenc-Drop-some-unused-function-arguments.patch
+post-9beta2/0062-cmdutils-Conditionally-compile-libswscale-related-bi.patch
+post-9beta2/0063-avconv-Drop-unused-function-argument-from-do_video_s.patch
+post-9beta2/0064-fate-Add-shorthands-for-acodec-PCM-and-ADPCM-tests.patch
+post-9beta2/0065-fate-ac3-Place-E-AC-3-tests-and-AC-3-tests-in-differ.patch
+post-9beta2/0066-fate-ac3-Add-dependencies.patch
+post-9beta2/0067-indeo3-remove-duplicate-capabilities-line.patch
+post-9beta2/0068-lavr-add-general-API-usage-doxy.patch
+post-9beta2/0069-lavr-document-upper-bound-on-number-of-output-sample.patch
+post-9beta2/0070-lpc-Add-a-function-for-calculating-reflection-coeffi.patch
+post-9beta2/0071-lpc-Add-a-function-for-calculating-reflection-coeffi.patch
+post-9beta2/0072-avcodec-Add-a-RFC-3389-comfort-noise-codec.patch
+post-9beta2/0073-lavfi-add-ashowinfo-filter.patch
+post-9beta2/0074-dv-use-AVStream.index-instead-of-abusing-AVStream.id.patch
+post-9beta2/0075-dv-fix-indentation.patch
+post-9beta2/0076-Remove-usage-of-INIT_AVX-in-h264_intrapred_10bit.asm.patch
+post-9beta2/0077-Remove-INIT_AVX-from-x86inc.asm.patch
+post-9beta2/0078-x86-use-PRED4x4-8x8-8x8L-16x16-macros-to-declare-int.patch
+post-9beta2/0079-Use-ptrdiff_t-instead-of-int-for-intra-pred-stride-f.patch
+post-9beta2/0080-FATE-fix-AD-PCM-test-dependencies-broken-in-e519990.patch
+post-9beta2/0081-configure-rewrite-print_config-function-using-awk.patch
+post-9beta2/0082-swscale-support-gray-to-9bit-and-10bit-formats.patch
+post-9beta2/0083-pixfmt-support-more-yuva-formats.patch
+post-9beta2/0084-configure-fix-print_config-with-broke-awks.patch
+post-9beta2/0085-cngdec-Update-the-LPC-coefficients-after-averaging-t.patch
+post-9beta2/0086-cngdec-Fix-the-memset-size-to-cover-the-full-array.patch
+post-9beta2/0087-cngdec-Make-the-dbov-variable-have-the-right-unit.patch
+post-9beta2/0088-cngdec-Allow-flushing-the-decoder.patch
+post-9beta2/0089-cng-Reindent-some-incorrectly-indented-lines.patch
+post-9beta2/0090-x86-include-x86inc.asm-in-x86util.asm.patch
+post-9beta2/0091-x86-yasm-Use-complete-source-path-for-macro-helper-i.patch
+post-9beta2/0092-x86-mmx2-mmxext-in-comments-and-messages.patch
+post-9beta2/0093-x86-mmx2-mmxext-in-variable-names.patch
+post-9beta2/0094-x86-MMX2-MMXEXT-in-macro-names.patch
+post-9beta2/0095-x86-fmtconvert-port-to-cpuflags.patch
+post-9beta2/0096-x86-fmtconvert-Refactor-cvtps2pi-emulation-through-c.patch
+post-9beta2/0097-x86-Fix-assembly-with-NASM.patch
+post-9beta2/0098-aacdec-Drop-some-unused-function-arguments.patch
+post-9beta2/0099-swscale-do-not-forget-to-swap-data-in-formats-with-d.patch
+post-9beta2/0100-x86-mmx2-mmxext-in-function-names.patch
+post-9beta2/0101-x86-h264_chromamc_10bit-drop-pointless-PAVG-define.patch
+post-9beta2/0102-x86-Move-optimization-suffix-to-end-of-function-name.patch
+post-9beta2/0103-avconv_opt-cmdutils-Add-missing-function-parameter-D.patch
+post-9beta2/0104-fate-add-ac3-eac3-tests-to-FATE_SAMPLES_AVCONV.patch
+post-9beta2/0105-lavc-move-SANE_NB_CHANNELS-to-internal.h-and-use-it-.patch
+post-9beta2/0106-lavc-check-channel-count-after-decoder-init.patch
+post-9beta2/0107-dca_parser-allow-the-parser-to-change-the-sample-rat.patch
+post-9beta2/0108-amrnbdec-set-channels-channel_layout-and-sample_rate.patch
+post-9beta2/0109-amrwbdec-set-channels-channel_layout-and-sample_rate.patch
+post-9beta2/0110-g722dec-set-channel-layout-at-initialization-instead.patch
+post-9beta2/0111-dsicinaudio-set-channels-and-channel-layout.patch
+post-9beta2/0112-atrac1-do-not-keep-a-copy-of-channel-count-in-the-pr.patch
+post-9beta2/0113-bmvaudio-set-channel-layout-at-init-rather-than-vali.patch
+post-9beta2/0114-cook-use-AVCodecContext.channels-instead-of-keeping-.patch
+post-9beta2/0115-cook-remove-unneeded-COOKContext-variable-bit_rate.patch
+post-9beta2/0116-cook-remove-unneeded-COOKContext-variable-sample_rat.patch
+post-9beta2/0117-cook-reverse-a-condition-so-that-the-code-makes-more.patch
+post-9beta2/0118-cook-use-av_get_channel_layout_nb_channels-instead-o.patch
+post-9beta2/0119-cook-move-samples_per_frame-from-COOKSubpacket-to-wh.patch
+post-9beta2/0120-cook-use-av_dlog-for-debug-logging-instead-of-av_log.patch
+post-9beta2/0121-dcadec-allow-the-decoder-to-change-the-channel-layou.patch
+post-9beta2/0122-flacdec-use-av_samples_-functions-for-sample-buffer-.patch
+post-9beta2/0123-flacdec-allow-mid-stream-channel-layout-change.patch
+post-9beta2/0124-flacdec-do-not-warn-on-sample-rate-change.patch
+post-9beta2/0125-g726dec-set-channel-layout-at-initialization-instead.patch
+post-9beta2/0126-g726dec-do-not-validate-sample-rate.patch
+post-9beta2/0127-libgsmdec-always-set-channel-layout-and-sample-rate-.patch
+post-9beta2/0128-gsmdec-always-set-channel-layout-and-sample-rate-at-.patch
+post-9beta2/0129-imc-set-channels-to-1-instead-of-validating-it.patch
+post-9beta2/0130-dpcm-use-AVCodecContext.channels-instead-of-keeping-.patch
+post-9beta2/0131-libilbc-set-channel-layout.patch
+post-9beta2/0132-libopencore-amr-set-channel-layout-for-amr-nb-or-if-.patch
+post-9beta2/0133-nellymoserdec-set-channels-to-1.patch
+post-9beta2/0134-qcelpdec-set-channel-layout.patch
+post-9beta2/0135-qdm2-make-sure-channels-is-not-0-and-set-channel-lay.patch
+post-9beta2/0136-qdm2-remove-unneeded-checks-for-channel-count.patch
+post-9beta2/0137-ra144dec-set-channel-layout.patch
+post-9beta2/0138-ra288dec-set-channel-layout.patch
+post-9beta2/0139-shorten-validate-that-the-channel-count-in-the-heade.patch
+post-9beta2/0140-sipr-set-channel-layout.patch
+post-9beta2/0141-truespeech-set-channel-layout.patch
+post-9beta2/0142-twinvq-validate-that-channels-is-not-0.patch
+post-9beta2/0143-twinvq-set-channel-layout.patch
+post-9beta2/0144-twinvq-validate-sample-rate-code.patch
+post-9beta2/0145-vmdaudio-set-channel-layout.patch
+post-9beta2/0146-wma-do-not-keep-private-copies-of-some-AVCodecContex.patch
+post-9beta2/0147-wmapro-use-AVCodecContext.channels-instead-of-keepin.patch
+post-9beta2/0148-wmavoice-set-channel-layout.patch
+post-9beta2/0149-ws-snd1-set-channel-layout.patch
+post-9beta2/0150-decode_audio3-initialize-AVFrame.patch
+post-9beta2/0151-doc-Point-to-the-new-location-of-the-c99-to-c89-tool.patch
+post-9beta2/0152-a64-remove-interleaved-mode.patch
+post-9beta2/0153-rtpdec-factorize-identical-code-used-in-several-hand.patch
+post-9beta2/0154-audiointerleave-deobfuscate-a-function-call.patch
+post-9beta2/0155-lavc-add-some-AVPacket-doxy.patch
+post-9beta2/0156-rtpdec_vp8-Don-t-parse-fields-that-aren-t-used.patch
+post-9beta2/0157-dv1394-Swap-the-min-and-max-values-of-the-standard-o.patch
+post-9beta2/0158-x86inc-Only-define-program_name-if-the-macro-is-unse.patch
+post-9beta2/0159-x86util-Add-cpuflags_mmxext-alias-for-cpuflags_mmx2.patch
+post-9beta2/0160-x86-ac3dsp-port-to-cpuflags.patch
+post-9beta2/0161-x86-PMINUB-port-to-cpuflags.patch
+post-9beta2/0162-PGS-subtitles-Expose-forced-flag.patch
+post-9beta2/0163-parser-Move-Doxygen-documentation-to-the-header-file.patch
+post-9beta2/0164-x86-Refactor-PSWAPD-fallback-implementations-and-por.patch
+post-9beta2/0165-vf_drawtext-do-not-use-deprecated-av_tree_node_size.patch
+post-9beta2/0166-crc-move-doxy-to-the-header.patch
+post-9beta2/0167-avconv-do-not-free-muxed-packet-on-streamcopy.patch
+post-9beta2/0168-lavf-clarify-the-lifetime-of-demuxed-packets.patch
+post-9beta2/0169-lavf-fix-av_interleaved_write_frame-doxy.patch
+post-9beta2/0170-matroskadec-do-not-use-avpacket-internals.patch
+post-9beta2/0171-doc-add-apidoc-target-for-doxygen-API-documentation.patch
+post-9beta2/0172-rtmp-Use-av_strlcat-instead-of-strncat.patch
+post-9beta2/0173-x86-vc1dsp-port-to-cpuflags.patch
+post-9beta2/0174-x86-PABSW-port-to-cpuflags.patch
+post-9beta2/0175-x86-h264qpel-Only-define-mmxext-QPEL-functions-if-H2.patch
+post-9beta2/0176-build-The-A64-muxer-depends-on-rawenc.o-for-ff_raw_w.patch
+post-9beta2/0177-fate-aac-Place-LATM-tests-and-general-AAC-tests-in-d.patch
+post-9beta2/0178-flacenc-use-a-separate-buffer-for-byte-swapping-for-.patch
+post-9beta2/0179-lavu-add-av_ctz-for-trailing-zero-bit-count.patch
+post-9beta2/0180-flacenc-remove-wasted-trailing-0-bits.patch
+post-9beta2/0181-flacenc-use-uint64_t-for-bit-counts.patch
+post-9beta2/0182-flacdsp-move-lpc-encoding-from-FLAC-encoder-to-FLACD.patch
+post-9beta2/0183-flacenc-add-24-bit-encoding.patch
+post-9beta2/0184-flacenc-use-RICE2-entropy-coding-mode-for-24-bit.patch
+post-9beta2/0185-FATE-rename-FLAC-tests-from-flac-to-flac-16.patch
+post-9beta2/0186-FATE-add-a-24-bit-FLAC-encoding-test.patch
+post-9beta2/0187-x86-avresample-Add-missing-colons-to-assembly-labels.patch
+post-9beta2/0188-fate-aac-cosmetics-Group-AAC-LATM-tests-together.patch
+post-9beta2/0189-fate-atrac-Place-atrac1-and-atrac3-tests-in-differen.patch
+post-9beta2/0190-libopencore-amr-Check-the-return-value-of-amr_decode.patch
+post-9beta2/0191-libvpxenc-Allow-enabling-constrained-quality-CQ-mode.patch
+post-9beta2/0192-x86-h264_intrapred-port-to-cpuflags.patch
+post-9beta2/0193-rtpenc_aac-Fix-calculation-of-the-header-size.patch
+post-9beta2/0194-add-24-bit-FLAC-encoding-to-Changelog.patch
+post-9beta2/0195-avconv-rescale-packet-duration-to-muxer-time-base-wh.patch
+post-9beta2/0196-flacenc-ensure-the-order-is-within-the-min-max-range.patch
+post-9beta2/0197-x86-h264_qpel_10bit-port-to-cpuflags.patch
+post-9beta2/0198-x86-PALIGNR-port-to-cpuflags.patch
+post-9beta2/0199-x86-h264_qpel_10bit-drop-unused-parameter-from-MC10-.patch
+post-9beta2/0200-x86inc-Set-program_name-outside-of-x86inc.asm.patch
+post-9beta2/0201-configure-add-lavu-dependency-to-lavr-lavfi-.pc-file.patch
+post-9beta2/0202-mss2-fix-handling-of-unmasked-implicit-WMV9-rectangl.patch
+post-9beta2/0203-mss2-reindent-after-last-commit.patch
+post-9beta2/0204-mss2-prevent-potential-uninitialized-reads.patch
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list