[haiku-commits] haiku: hrev43830 - in src/add-ons/media/plugins/ffmpeg: libavcodec libavformat libavcodec/x86 libswscale

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 7 Mar 2012 02:06:21 +0100 (CET)

hrev43830 adds 2 changesets to branch 'master'
old head: 08601a84881b975db1feef1047eab8bc63b08168
new head: 7007402957f67a3ccd2698399634af182dd19cc0

----------------------------------------------------------------------------

e40d995: FFMpeg plugin: now build against the optional package for 0.10
  
  * added optional feature package for ffmpeg 0.10 gcc4 and gcc2
  * increased probe buffer size to 8K for now.
  * built the optional packages the default way, it might need adjustments
    like dependencies on speex, ogg, theora, vorbis, which I left out for now.

7007402: DVB: add a dependency on FFMpeg optional package
  
  * MediaFormat.cpp includes avcodec.h from libavcodec without actually
    using the library.

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

1042 files changed, 72 insertions(+), 427222 deletions(-)
build/jam/OptionalBuildFeatures                    |   36 +
src/add-ons/media/media-add-ons/dvb/Jamfile        |   11 +-
.../media/plugins/ffmpeg/AVFormatReader.cpp        |   10 +-
src/add-ons/media/plugins/ffmpeg/CodecTable.cpp    |    1 -
src/add-ons/media/plugins/ffmpeg/Jamfile           |   42 +-
src/add-ons/media/plugins/ffmpeg/libavcodec/4xm.c  |  855 --
src/add-ons/media/plugins/ffmpeg/libavcodec/8bps.c |  233 -
src/add-ons/media/plugins/ffmpeg/libavcodec/8svx.c |  113 -
.../media/plugins/ffmpeg/libavcodec/Jamfile        |  392 -
src/add-ons/media/plugins/ffmpeg/libavcodec/aac.h  |  290 -
.../plugins/ffmpeg/libavcodec/aac_ac3_parser.c     |  102 -
.../plugins/ffmpeg/libavcodec/aac_ac3_parser.h     |   65 -
.../plugins/ffmpeg/libavcodec/aac_adtstoasc_bsf.c  |  114 -
.../media/plugins/ffmpeg/libavcodec/aac_parser.c   |  112 -
.../media/plugins/ffmpeg/libavcodec/aac_parser.h   |   55 -
.../media/plugins/ffmpeg/libavcodec/aac_tablegen.c |   39 -
.../media/plugins/ffmpeg/libavcodec/aac_tablegen.h |   42 -
.../plugins/ffmpeg/libavcodec/aac_tablegen_decl.h  |   34 -
.../media/plugins/ffmpeg/libavcodec/aaccoder.c     |  960 --
.../media/plugins/ffmpeg/libavcodec/aacdec.c       | 2142 ---
.../media/plugins/ffmpeg/libavcodec/aacdectab.h    |   95 -
.../media/plugins/ffmpeg/libavcodec/aacenc.c       |  644 -
.../media/plugins/ffmpeg/libavcodec/aacenc.h       |   71 -
.../media/plugins/ffmpeg/libavcodec/aacps.c        | 1037 --
.../media/plugins/ffmpeg/libavcodec/aacps.h        |   82 -
.../plugins/ffmpeg/libavcodec/aacps_tablegen.c     |   93 -
.../plugins/ffmpeg/libavcodec/aacps_tablegen.h     |  212 -
.../media/plugins/ffmpeg/libavcodec/aacpsdata.c    |  163 -
.../media/plugins/ffmpeg/libavcodec/aacpsy.c       |  318 -
.../media/plugins/ffmpeg/libavcodec/aacpsy.h       |   50 -
.../media/plugins/ffmpeg/libavcodec/aacsbr.c       | 1771 ---
.../media/plugins/ffmpeg/libavcodec/aacsbr.h       |   49 -
.../media/plugins/ffmpeg/libavcodec/aacsbrdata.h   |  614 -
.../media/plugins/ffmpeg/libavcodec/aactab.c       | 1207 --
.../media/plugins/ffmpeg/libavcodec/aactab.h       |   77 -
.../media/plugins/ffmpeg/libavcodec/aandcttab.c    |   47 -
.../media/plugins/ffmpeg/libavcodec/aandcttab.h    |   32 -
src/add-ons/media/plugins/ffmpeg/libavcodec/aasc.c |  123 -
src/add-ons/media/plugins/ffmpeg/libavcodec/ac3.c  |  281 -
src/add-ons/media/plugins/ffmpeg/libavcodec/ac3.h  |  187 -
.../media/plugins/ffmpeg/libavcodec/ac3_parser.c   |  207 -
.../media/plugins/ffmpeg/libavcodec/ac3_parser.h   |   52 -
.../media/plugins/ffmpeg/libavcodec/ac3dec.c       | 1462 --
.../media/plugins/ffmpeg/libavcodec/ac3dec.h       |  232 -
.../media/plugins/ffmpeg/libavcodec/ac3dec_data.c  |   72 -
.../media/plugins/ffmpeg/libavcodec/ac3dec_data.h  |   34 -
.../media/plugins/ffmpeg/libavcodec/ac3enc.c       | 1425 --
.../media/plugins/ffmpeg/libavcodec/ac3tab.c       |  305 -
.../media/plugins/ffmpeg/libavcodec/ac3tab.h       |   62 -
.../plugins/ffmpeg/libavcodec/acelp_filters.c      |  145 -
.../plugins/ffmpeg/libavcodec/acelp_filters.h      |  120 -
.../plugins/ffmpeg/libavcodec/acelp_pitch_delay.c  |  186 -
.../plugins/ffmpeg/libavcodec/acelp_pitch_delay.h  |  255 -
.../plugins/ffmpeg/libavcodec/acelp_vectors.c      |  270 -
.../plugins/ffmpeg/libavcodec/acelp_vectors.h      |  264 -
.../media/plugins/ffmpeg/libavcodec/adpcm.c        | 1701 ---
src/add-ons/media/plugins/ffmpeg/libavcodec/adx.h  |   49 -
.../media/plugins/ffmpeg/libavcodec/adxdec.c       |  180 -
.../media/plugins/ffmpeg/libavcodec/adxenc.c       |  197 -
src/add-ons/media/plugins/ffmpeg/libavcodec/alac.c |  712 -
.../media/plugins/ffmpeg/libavcodec/alacenc.c      |  532 -
.../media/plugins/ffmpeg/libavcodec/allcodecs.c    |  385 -
.../media/plugins/ffmpeg/libavcodec/alsdec.c       | 1636 ---
.../media/plugins/ffmpeg/libavcodec/amrnbdata.h    | 1672 ---
.../media/plugins/ffmpeg/libavcodec/amrnbdec.c     | 1076 --
src/add-ons/media/plugins/ffmpeg/libavcodec/anm.c  |  197 -
.../media/plugins/ffmpeg/libavcodec/apedec.c       |  891 --
.../media/plugins/ffmpeg/libavcodec/api-example.c  |  467 -
src/add-ons/media/plugins/ffmpeg/libavcodec/asv1.c |  668 -
.../media/plugins/ffmpeg/libavcodec/atrac.c        |  120 -
.../media/plugins/ffmpeg/libavcodec/atrac.h        |   38 -
.../media/plugins/ffmpeg/libavcodec/atrac1.c       |  377 -
.../media/plugins/ffmpeg/libavcodec/atrac1data.h   |   64 -
.../media/plugins/ffmpeg/libavcodec/atrac3.c       | 1026 --
.../media/plugins/ffmpeg/libavcodec/atrac3data.h   |  133 -
.../media/plugins/ffmpeg/libavcodec/audioconvert.c |  243 -
.../media/plugins/ffmpeg/libavcodec/audioconvert.h |  115 -
src/add-ons/media/plugins/ffmpeg/libavcodec/aura.c |  138 -
.../media/plugins/ffmpeg/libavcodec/avcodec.h      | 3968 ------
.../media/plugins/ffmpeg/libavcodec/avfft.c        |  142 -
.../media/plugins/ffmpeg/libavcodec/avfft.h        |   99 -
.../media/plugins/ffmpeg/libavcodec/avpacket.c     |   99 -
src/add-ons/media/plugins/ffmpeg/libavcodec/avs.c  |  164 -
.../media/plugins/ffmpeg/libavcodec/beosthread.c   |  183 -
.../plugins/ffmpeg/libavcodec/bethsoftvideo.c      |  143 -
.../plugins/ffmpeg/libavcodec/bethsoftvideo.h      |   36 -
src/add-ons/media/plugins/ffmpeg/libavcodec/bfi.c  |  184 -
src/add-ons/media/plugins/ffmpeg/libavcodec/bgmc.c |  567 -
src/add-ons/media/plugins/ffmpeg/libavcodec/bgmc.h |   56 -
src/add-ons/media/plugins/ffmpeg/libavcodec/bink.c | 1012 --
.../media/plugins/ffmpeg/libavcodec/binkaudio.c    |  311 -
.../media/plugins/ffmpeg/libavcodec/binkdata.h     |  614 -
.../media/plugins/ffmpeg/libavcodec/binkidct.c     |  112 -
.../media/plugins/ffmpeg/libavcodec/bitstream.c    |  482 -
.../plugins/ffmpeg/libavcodec/bitstream_filter.c   |   65 -
src/add-ons/media/plugins/ffmpeg/libavcodec/bmp.c  |  349 -
src/add-ons/media/plugins/ffmpeg/libavcodec/bmp.h  |   38 -
.../media/plugins/ffmpeg/libavcodec/bmpenc.c       |  149 -
.../media/plugins/ffmpeg/libavcodec/bytestream.h   |   71 -
[ *** stats truncated: 943 lines dropped *** ]

############################################################################

Commit:      e40d995cf452857204748974431023cf2e78cec2
URL:         http://cgit.haiku-os.org/haiku/commit/?id=e40d995
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Wed Mar  7 00:41:23 2012 UTC

FFMpeg plugin: now build against the optional package for 0.10

* added optional feature package for ffmpeg 0.10 gcc4 and gcc2
* increased probe buffer size to 8K for now.
* built the optional packages the default way, it might need adjustments
  like dependencies on speex, ogg, theora, vorbis, which I left out for now.

----------------------------------------------------------------------------

diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures
index 8930911..e54a0a9 100644
--- a/build/jam/OptionalBuildFeatures
+++ b/build/jam/OptionalBuildFeatures
@@ -211,6 +211,42 @@ if $(TARGET_ARCH) = x86 {
 }
 
 
+# FFmpeg
+local ffmpegBaseURL = http://haiku-files.org/files/optional-packages ;
+if $(TARGET_ARCH) = x86 {
+       if $(HAIKU_GCC_VERSION[1]) >= 4 {
+               HAIKU_FFMPEG_FILE = ffmpeg-0.10-x86-gcc4-2012-02-19.zip ;
+       } else {
+               HAIKU_FFMPEG_FILE = ffmpeg-0.10-x86-gcc2-2012-03-07.zip ;
+       }
+
+       local zipFile = [ DownloadFile $(HAIKU_FFMPEG_FILE)
+               : $(ffmpegBaseURL)/$(HAIKU_FFMPEG_FILE) ] ;
+
+       HAIKU_FFMPEG_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
+               $(HAIKU_FFMPEG_FILE:B) ] ;
+
+       HAIKU_FFMPEG_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_FFMPEG_DIR)
+               : common/include/ : $(zipFile) : extracted-ffmpeg ] ;
+
+       HAIKU_FFMPEG_LIBS = [ ExtractArchive $(HAIKU_FFMPEG_DIR)
+               :
+               common/lib/libavformat.a
+               common/lib/libavcodec.a
+               common/lib/libavdevice.a
+               common/lib/libavfilter.a
+               common/lib/libswscale.a
+               common/lib/libavutil.a
+               : $(zipFile)
+               : extracted-ffmpeg ] ;
+
+       HAIKU_FFMPEG_HEADERS = [ FDirName $(HAIKU_FFMPEG_DIR) common include ] ;
+
+} else {
+       Echo "FFMpeg support not available on $(TARGET_ARCH)" ;
+}
+
+
 # TagLib
 
 # Automatically install the TagLib feature, when the optional TagLib optional
diff --git a/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 
b/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
index 2ac8a81..66d5e1f 100644
--- a/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
+++ b/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
@@ -255,7 +255,7 @@ StreamBase::Open()
        if (buffer == NULL)
                return B_NO_MEMORY;
 
-       size_t probeSize = 2048;
+       size_t probeSize = 8192;
        AVProbeData probeData;
        probeData.filename = "";
        probeData.buf = buffer;
@@ -417,10 +417,10 @@ StreamBase::FrameRate() const
        // TODO: Find a way to always calculate a correct frame rate...
        double frameRate = 1.0;
        switch (fStream->codec->codec_type) {
-               case CODEC_TYPE_AUDIO:
+               case AVMEDIA_TYPE_AUDIO:
                        frameRate = (double)fStream->codec->sample_rate;
                        break;
-               case CODEC_TYPE_VIDEO:
+               case AVMEDIA_TYPE_VIDEO:
                        if (fStream->avg_frame_rate.den && 
fStream->avg_frame_rate.num)
                                frameRate = av_q2d(fStream->avg_frame_rate);
                        else if (fStream->r_frame_rate.den && 
fStream->r_frame_rate.num)
@@ -734,7 +734,7 @@ StreamBase::GetNextChunk(const void** chunkBuffer,
                                break;
                        case B_MEDIA_ENCODED_AUDIO:
                                mediaHeader->u.encoded_audio.buffer_flags
-                                       = (fPacket.flags & PKT_FLAG_KEY) ? 
B_MEDIA_KEY_FRAME : 0;
+                                       = (fPacket.flags & AV_PKT_FLAG_KEY) ? 
B_MEDIA_KEY_FRAME : 0;
                                break;
                        case B_MEDIA_RAW_VIDEO:
                                mediaHeader->u.raw_video.line_count
@@ -742,7 +742,7 @@ StreamBase::GetNextChunk(const void** chunkBuffer,
                                break;
                        case B_MEDIA_ENCODED_VIDEO:
                                mediaHeader->u.encoded_video.field_flags
-                                       = (fPacket.flags & PKT_FLAG_KEY) ? 
B_MEDIA_KEY_FRAME : 0;
+                                       = (fPacket.flags & AV_PKT_FLAG_KEY) ? 
B_MEDIA_KEY_FRAME : 0;
                                mediaHeader->u.encoded_video.line_count
                                        = 
fFormat.u.encoded_video.output.display.line_count;
                                break;
diff --git a/src/add-ons/media/plugins/ffmpeg/CodecTable.cpp 
b/src/add-ons/media/plugins/ffmpeg/CodecTable.cpp
index 8424e81..dd5e0ce 100644
--- a/src/add-ons/media/plugins/ffmpeg/CodecTable.cpp
+++ b/src/add-ons/media/plugins/ffmpeg/CodecTable.cpp
@@ -8,7 +8,6 @@
 
 extern "C" {
        #include "avcodec.h"
-       #include "libavformat/internal.h"
        #include "avformat.h"
 }
 
diff --git a/src/add-ons/media/plugins/ffmpeg/Jamfile 
b/src/add-ons/media/plugins/ffmpeg/Jamfile
index 7fc1bc2..bdce01b 100644
--- a/src/add-ons/media/plugins/ffmpeg/Jamfile
+++ b/src/add-ons/media/plugins/ffmpeg/Jamfile
@@ -4,15 +4,10 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
 
 UsePrivateHeaders media shared ;
 
-SubDirHdrs [ FDirName $(SUBDIR) libavcodec ] ;
-SubDirHdrs [ FDirName $(SUBDIR) libavformat ] ;
-SubDirHdrs [ FDirName $(SUBDIR) libavutil ] ;
-SubDirHdrs [ FDirName $(SUBDIR) libswscale ] ;
+SubDirC++Flags -D__STDC_CONSTANT_MACROS -Wno-deprecated-declarations ;
 
-SubDirC++Flags -D__STDC_CONSTANT_MACROS ;
-
-Addon ffmpeg :
-       AVCodecDecoder.cpp
+local sources =
+       AVCodecDecoder.cpp
        AVCodecEncoder.cpp
        AVFormatReader.cpp
        AVFormatWriter.cpp
@@ -22,6 +17,22 @@ Addon ffmpeg :
        FFmpegPlugin.cpp
        MuxerTable.cpp
        CpuCapabilities.cpp
+       ;
+
+
+SubDirSysHdrs $(HAIKU_FFMPEG_HEADERS) ;
+Includes [ FGristFiles $(sources) ] : $(HAIKU_FFMPEG_HEADERS_DEPENDENCY) ;
+
+UseHeaders [ FDirName $(HAIKU_FFMPEG_HEADERS) ] ;
+UseHeaders [ FDirName $(HAIKU_FFMPEG_HEADERS) libavcodec ] ;
+UseHeaders [ FDirName $(HAIKU_FFMPEG_HEADERS) libavdevice ] ;
+UseHeaders [ FDirName $(HAIKU_FFMPEG_HEADERS) libavfilter ] ;
+UseHeaders [ FDirName $(HAIKU_FFMPEG_HEADERS) libavformat ] ;
+UseHeaders [ FDirName $(HAIKU_FFMPEG_HEADERS) libavutil ] ;
+UseHeaders [ FDirName $(HAIKU_FFMPEG_HEADERS) libswscale ] ;
+
+Addon ffmpeg :
+       $(sources)
 
        gfx_conv_c.cpp
        gfx_conv_c_lookup.cpp
@@ -31,11 +42,9 @@ Addon ffmpeg :
        yuvrgb_sse2.nasm
        yuvrgb_ssse3.nasm
        :
-       libavformat.a
-       libavcodec.a
-       libavcodec_$(TARGET_ARCH).a
-       libavutil.a
-       libswscale.a
+
+       # FFmpeg libraries (from FFmpeg optional package):
+       $(HAIKU_FFMPEG_LIBS)
 
        libvorbis_ffmpeg.a
        libspeex_ffmpeg.a
@@ -44,9 +53,10 @@ Addon ffmpeg :
        libbz2_ffmpeg.a
 
        be
-       libmedia.so
+       media
        libz.a
        $(TARGET_LIBSUPC++)
+       $(TARGET_NETWORK_LIBS)
 ;
 
 # FFmpeg libs configuration is in the config.h header. Architecture specific
@@ -112,12 +122,8 @@ if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
 
 HAIKU_FFMPEG_DEFINES = [ FDefines $(HAIKU_FFMPEG_DEFINES) ] ;
 
-SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavcodec ;
-SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavformat ;
-SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavutil ;
 SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libbz2 ;
 SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libogg ;
-SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libswscale ;
 SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libspeex ;
 SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libtheora ;
 SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libvorbis ;
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/4xm.c 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/4xm.c
deleted file mode 100644
index 2198503..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/4xm.c
+++ /dev/null
@@ -1,855 +0,0 @@
-/*
- * 4XM codec
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * 4XM codec.
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "bytestream.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-#define BLOCK_TYPE_VLC_BITS 5
-#define ACDC_VLC_BITS 9
-
-#define CFRAME_BUFFER_COUNT 100
-
-static const uint8_t block_type_tab[2][4][8][2]={
- {
-  {   //{8,4,2}x{8,4,2}
-    { 0,1}, { 2,2}, { 6,3}, {14,4}, {30,5}, {31,5}, { 0,0}
-  },{ //{8,4}x1
-    { 0,1}, { 0,0}, { 2,2}, { 6,3}, {14,4}, {15,4}, { 0,0}
-  },{ //1x{8,4}
-    { 0,1}, { 2,2}, { 0,0}, { 6,3}, {14,4}, {15,4}, { 0,0}
-  },{ //1x2, 2x1
-    { 0,1}, { 0,0}, { 0,0}, { 2,2}, { 6,3}, {14,4}, {15,4}
-  }
- },{
-  {  //{8,4,2}x{8,4,2}
-    { 1,2}, { 4,3}, { 5,3}, {0,2}, {6,3}, {7,3}, {0,0}
-  },{//{8,4}x1
-    { 1,2}, { 0,0}, { 2,2}, {0,2}, {6,3}, {7,3}, {0,0}
-  },{//1x{8,4}
-    { 1,2}, { 2,2}, { 0,0}, {0,2}, {6,3}, {7,3}, {0,0}
-  },{//1x2, 2x1
-    { 1,2}, { 0,0}, { 0,0}, {0,2}, {2,2}, {6,3}, {7,3}
-  }
- }
-};
-
-static const uint8_t size2index[4][4]={
-  {-1, 3, 1, 1},
-  { 3, 0, 0, 0},
-  { 2, 0, 0, 0},
-  { 2, 0, 0, 0},
-};
-
-static const int8_t mv[256][2]={
-{  0,  0},{  0, -1},{ -1,  0},{  1,  0},{  0,  1},{ -1, -1},{  1, -1},{ -1,  
1},
-{  1,  1},{  0, -2},{ -2,  0},{  2,  0},{  0,  2},{ -1, -2},{  1, -2},{ -2, 
-1},
-{  2, -1},{ -2,  1},{  2,  1},{ -1,  2},{  1,  2},{ -2, -2},{  2, -2},{ -2,  
2},
-{  2,  2},{  0, -3},{ -3,  0},{  3,  0},{  0,  3},{ -1, -3},{  1, -3},{ -3, 
-1},
-{  3, -1},{ -3,  1},{  3,  1},{ -1,  3},{  1,  3},{ -2, -3},{  2, -3},{ -3, 
-2},
-{  3, -2},{ -3,  2},{  3,  2},{ -2,  3},{  2,  3},{  0, -4},{ -4,  0},{  4,  
0},
-{  0,  4},{ -1, -4},{  1, -4},{ -4, -1},{  4, -1},{  4,  1},{ -1,  4},{  1,  
4},
-{ -3, -3},{ -3,  3},{  3,  3},{ -2, -4},{ -4, -2},{  4, -2},{ -4,  2},{ -2,  
4},
-{  2,  4},{ -3, -4},{  3, -4},{  4, -3},{ -5,  0},{ -4,  3},{ -3,  4},{  3,  
4},
-{ -1, -5},{ -5, -1},{ -5,  1},{ -1,  5},{ -2, -5},{  2, -5},{  5, -2},{  5,  
2},
-{ -4, -4},{ -4,  4},{ -3, -5},{ -5, -3},{ -5,  3},{  3,  5},{ -6,  0},{  0,  
6},
-{ -6, -1},{ -6,  1},{  1,  6},{  2, -6},{ -6,  2},{  2,  6},{ -5, -4},{  5,  
4},
-{  4,  5},{ -6, -3},{  6,  3},{ -7,  0},{ -1, -7},{  5, -5},{ -7,  1},{ -1,  
7},
-{  4, -6},{  6,  4},{ -2, -7},{ -7,  2},{ -3, -7},{  7, -3},{  3,  7},{  6, 
-5},
-{  0, -8},{ -1, -8},{ -7, -4},{ -8,  1},{  4,  7},{  2, -8},{ -2,  8},{  6,  
6},
-{ -8,  3},{  5, -7},{ -5,  7},{  8, -4},{  0, -9},{ -9, -1},{  1,  9},{  7, 
-6},
-{ -7,  6},{ -5, -8},{ -5,  8},{ -9,  3},{  9, -4},{  7, -7},{  8, -6},{  6,  
8},
-{ 10,  1},{-10,  2},{  9, -5},{ 10, -3},{ -8, -7},{-10, -4},{  6, -9},{-11,  
0},
-{ 11,  1},{-11, -2},{ -2, 11},{  7, -9},{ -7,  9},{ 10,  6},{ -4, 11},{  8, 
-9},
-{  8,  9},{  5, 11},{  7,-10},{ 12, -3},{ 11,  6},{ -9, -9},{  8, 10},{  5, 
12},
-{-11,  7},{ 13,  2},{  6,-12},{ 10,  9},{-11,  8},{ -7, 12},{  0, 14},{ 14, 
-2},
-{ -9, 11},{ -6, 13},{-14, -4},{ -5,-14},{  5, 14},{-15, -1},{-14, -6},{  
3,-15},
-{ 11,-11},{ -7, 14},{ -5, 15},{  8,-14},{ 15,  6},{  3, 16},{  7,-15},{-16,  
5},
-{  0, 17},{-16, -6},{-10, 14},{-16,  7},{ 12, 13},{-16,  8},{-17,  6},{-18,  
3},
-{ -7, 17},{ 15, 11},{ 16, 10},{  2,-19},{  3,-19},{-11,-16},{-18,  8},{-19, 
-6},
-{  2,-20},{-17,-11},{-10,-18},{  8, 19},{-21, -1},{-20,  7},{ -4, 21},{ 21,  
5},
-{ 15, 16},{  2,-22},{-10,-20},{-22,  5},{ 20,-11},{ -7,-22},{-12, 20},{ 23, 
-5},
-{ 13,-20},{ 24, -2},{-15, 19},{-11, 22},{ 16, 19},{ 23,-10},{-18,-18},{ 
-9,-24},
-{ 24,-10},{ -3, 26},{-23, 13},{-18,-20},{ 17, 21},{ -4, 27},{ 27,  6},{  
1,-28},
-{-11, 26},{-17,-23},{  7, 28},{ 11,-27},{ 29,  5},{-23,-19},{-28,-11},{-21, 
22},
-{-30,  7},{-17, 26},{-27, 16},{ 13, 29},{ 19,-26},{ 10,-31},{-14,-30},{ 
20,-27},
-{-29, 18},{-16,-31},{-28,-22},{ 21,-30},{-25, 28},{ 26,-29},{ 25,-32},{-32,-32}
-};
-
-// this is simply the scaled down elementwise product of the standard jpeg 
quantizer table and the AAN premul table
-static const uint8_t dequant_table[64]={
- 16, 15, 13, 19, 24, 31, 28, 17,
- 17, 23, 25, 31, 36, 63, 45, 21,
- 18, 24, 27, 37, 52, 59, 49, 20,
- 16, 28, 34, 40, 60, 80, 51, 20,
- 18, 31, 48, 66, 68, 86, 56, 21,
- 19, 38, 56, 59, 64, 64, 48, 20,
- 27, 48, 55, 55, 56, 51, 35, 15,
- 20, 35, 34, 32, 31, 22, 15,  8,
-};
-
-static VLC block_type_vlc[2][4];
-
-
-typedef struct CFrameBuffer{
-    unsigned int allocated_size;
-    unsigned int size;
-    int id;
-    uint8_t *data;
-}CFrameBuffer;
-
-typedef struct FourXContext{
-    AVCodecContext *avctx;
-    DSPContext dsp;
-    AVFrame current_picture, last_picture;
-    GetBitContext pre_gb;          ///< ac/dc prefix
-    GetBitContext gb;
-    const uint8_t *bytestream;
-    const uint16_t *wordstream;
-    int mv[256];
-    VLC pre_vlc;
-    int last_dc;
-    DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
-    void *bitstream_buffer;
-    unsigned int bitstream_buffer_size;
-    int version;
-    CFrameBuffer cfrm[CFRAME_BUFFER_COUNT];
-} FourXContext;
-
-
-#define FIX_1_082392200  70936
-#define FIX_1_414213562  92682
-#define FIX_1_847759065 121095
-#define FIX_2_613125930 171254
-
-#define MULTIPLY(var,const)  (((var)*(const)) >> 16)
-
-static void idct(DCTELEM block[64]){
-    int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-    int tmp10, tmp11, tmp12, tmp13;
-    int z5, z10, z11, z12, z13;
-    int i;
-    int temp[64];
-
-    for(i=0; i<8; i++){
-        tmp10 = block[8*0 + i] + block[8*4 + i];
-        tmp11 = block[8*0 + i] - block[8*4 + i];
-
-        tmp13 =          block[8*2 + i] + block[8*6 + i];
-        tmp12 = MULTIPLY(block[8*2 + i] - block[8*6 + i], FIX_1_414213562) - 
tmp13;
-
-        tmp0 = tmp10 + tmp13;
-        tmp3 = tmp10 - tmp13;
-        tmp1 = tmp11 + tmp12;
-        tmp2 = tmp11 - tmp12;
-
-        z13 = block[8*5 + i] + block[8*3 + i];
-        z10 = block[8*5 + i] - block[8*3 + i];
-        z11 = block[8*1 + i] + block[8*7 + i];
-        z12 = block[8*1 + i] - block[8*7 + i];
-
-        tmp7  =          z11 + z13;
-        tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);
-
-        z5    = MULTIPLY(z10 + z12, FIX_1_847759065);
-        tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5;
-        tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5;
-
-        tmp6 = tmp12 - tmp7;
-        tmp5 = tmp11 - tmp6;
-        tmp4 = tmp10 + tmp5;
-
-        temp[8*0 + i] = tmp0 + tmp7;
-        temp[8*7 + i] = tmp0 - tmp7;
-        temp[8*1 + i] = tmp1 + tmp6;
-        temp[8*6 + i] = tmp1 - tmp6;
-        temp[8*2 + i] = tmp2 + tmp5;
-        temp[8*5 + i] = tmp2 - tmp5;
-        temp[8*4 + i] = tmp3 + tmp4;
-        temp[8*3 + i] = tmp3 - tmp4;
-    }
-
-    for(i=0; i<8*8; i+=8){
-        tmp10 = temp[0 + i] + temp[4 + i];
-        tmp11 = temp[0 + i] - temp[4 + i];
-
-        tmp13 = temp[2 + i] + temp[6 + i];
-        tmp12 = MULTIPLY(temp[2 + i] - temp[6 + i], FIX_1_414213562) - tmp13;
-
-        tmp0 = tmp10 + tmp13;
-        tmp3 = tmp10 - tmp13;
-        tmp1 = tmp11 + tmp12;
-        tmp2 = tmp11 - tmp12;
-
-        z13 = temp[5 + i] + temp[3 + i];
-        z10 = temp[5 + i] - temp[3 + i];
-        z11 = temp[1 + i] + temp[7 + i];
-        z12 = temp[1 + i] - temp[7 + i];
-
-        tmp7 = z11 + z13;
-        tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);
-
-        z5 = MULTIPLY(z10 + z12, FIX_1_847759065);
-        tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5;
-        tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5;
-
-        tmp6 = tmp12 - tmp7;
-        tmp5 = tmp11 - tmp6;
-        tmp4 = tmp10 + tmp5;
-
-        block[0 + i] = (tmp0 + tmp7)>>6;
-        block[7 + i] = (tmp0 - tmp7)>>6;
-        block[1 + i] = (tmp1 + tmp6)>>6;
-        block[6 + i] = (tmp1 - tmp6)>>6;
-        block[2 + i] = (tmp2 + tmp5)>>6;
-        block[5 + i] = (tmp2 - tmp5)>>6;
-        block[4 + i] = (tmp3 + tmp4)>>6;
-        block[3 + i] = (tmp3 - tmp4)>>6;
-    }
-}
-
-static av_cold void init_vlcs(FourXContext *f){
-    static VLC_TYPE table[8][32][2];
-    int i;
-
-    for(i=0; i<8; i++){
-        block_type_vlc[0][i].table= table[i];
-        block_type_vlc[0][i].table_allocated= 32;
-        init_vlc(&block_type_vlc[0][i], BLOCK_TYPE_VLC_BITS, 7,
-                 &block_type_tab[0][i][0][1], 2, 1,
-                 &block_type_tab[0][i][0][0], 2, 1, INIT_VLC_USE_NEW_STATIC);
-    }
-}
-
-static void init_mv(FourXContext *f){
-    int i;
-
-    for(i=0; i<256; i++){
-        if(f->version>1)
-            f->mv[i] = mv[i][0]   + mv[i][1]  
*f->current_picture.linesize[0]/2;
-        else
-            f->mv[i] = (i&15) - 8 + 
((i>>4)-8)*f->current_picture.linesize[0]/2;
-    }
-}
-
-static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int 
stride, int scale, int dc){
-   int i;
-   dc*= 0x10001;
-
-   switch(log2w){
-   case 0:
-        for(i=0; i<h; i++){
-            dst[0] = scale*src[0] + dc;
-            if(scale) src += stride;
-            dst += stride;
-        }
-        break;
-    case 1:
-        for(i=0; i<h; i++){
-            ((uint32_t*)dst)[0] = scale*((uint32_t*)src)[0] + dc;
-            if(scale) src += stride;
-            dst += stride;
-        }
-        break;
-    case 2:
-        for(i=0; i<h; i++){
-            ((uint32_t*)dst)[0] = scale*((uint32_t*)src)[0] + dc;
-            ((uint32_t*)dst)[1] = scale*((uint32_t*)src)[1] + dc;
-            if(scale) src += stride;
-            dst += stride;
-        }
-        break;
-    case 3:
-        for(i=0; i<h; i++){
-            ((uint32_t*)dst)[0] = scale*((uint32_t*)src)[0] + dc;
-            ((uint32_t*)dst)[1] = scale*((uint32_t*)src)[1] + dc;
-            ((uint32_t*)dst)[2] = scale*((uint32_t*)src)[2] + dc;
-            ((uint32_t*)dst)[3] = scale*((uint32_t*)src)[3] + dc;
-            if(scale) src += stride;
-            dst += stride;
-        }
-        break;
-    default: assert(0);
-    }
-}
-
-static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int 
log2w, int log2h, int stride){
-    const int index= size2index[log2h][log2w];
-    const int h= 1<<log2h;
-    int code= get_vlc2(&f->gb, block_type_vlc[1-(f->version>1)][index].table, 
BLOCK_TYPE_VLC_BITS, 1);
-    uint16_t *start= (uint16_t*)f->last_picture.data[0];
-    uint16_t *end= start + stride*(f->avctx->height-h+1) - (1<<log2w);
-
-    assert(code>=0 && code<=6);
-
-    if(code == 0){
-        src += f->mv[ *f->bytestream++ ];
-        if(start > src || src > end){
-            av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
-            return;
-        }
-        mcdc(dst, src, log2w, h, stride, 1, 0);
-    }else if(code == 1){
-        log2h--;
-        decode_p_block(f, dst                  , src                  , log2w, 
log2h, stride);
-        decode_p_block(f, dst + (stride<<log2h), src + (stride<<log2h), log2w, 
log2h, stride);
-    }else if(code == 2){
-        log2w--;
-        decode_p_block(f, dst             , src             , log2w, log2h, 
stride);
-        decode_p_block(f, dst + (1<<log2w), src + (1<<log2w), log2w, log2h, 
stride);
-    }else if(code == 3 && f->version<2){
-        mcdc(dst, src, log2w, h, stride, 1, 0);
-    }else if(code == 4){
-        src += f->mv[ *f->bytestream++ ];
-        if(start > src || src > end){
-            av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
-            return;
-        }
-        mcdc(dst, src, log2w, h, stride, 1, le2me_16(*f->wordstream++));
-    }else if(code == 5){
-        mcdc(dst, src, log2w, h, stride, 0, le2me_16(*f->wordstream++));
-    }else if(code == 6){
-        if(log2w){
-            dst[0] = le2me_16(*f->wordstream++);
-            dst[1] = le2me_16(*f->wordstream++);
-        }else{
-            dst[0     ] = le2me_16(*f->wordstream++);
-            dst[stride] = le2me_16(*f->wordstream++);
-        }
-    }
-}
-
-static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
-    int x, y;
-    const int width= f->avctx->width;
-    const int height= f->avctx->height;
-    uint16_t *src= (uint16_t*)f->last_picture.data[0];
-    uint16_t *dst= (uint16_t*)f->current_picture.data[0];
-    const int stride= f->current_picture.linesize[0]>>1;
-    unsigned int bitstream_size, bytestream_size, wordstream_size, extra;
-
-    if(f->version>1){
-        extra=20;
-        bitstream_size= AV_RL32(buf+8);
-        wordstream_size= AV_RL32(buf+12);
-        bytestream_size= AV_RL32(buf+16);
-    }else{
-        extra=0;
-        bitstream_size = AV_RL16(buf-4);
-        wordstream_size= AV_RL16(buf-2);
-        bytestream_size= FFMAX(length - bitstream_size - wordstream_size, 0);
-    }
-
-    if(bitstream_size+ bytestream_size+ wordstream_size + extra != length
-       || bitstream_size  > (1<<26)
-       || bytestream_size > (1<<26)
-       || wordstream_size > (1<<26)
-       ){
-        av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", 
bitstream_size, bytestream_size, wordstream_size,
-        bitstream_size+ bytestream_size+ wordstream_size - length);
-        return -1;
-    }
-
-    av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size, 
bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!f->bitstream_buffer)
-        return AVERROR(ENOMEM);
-    f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra), 
bitstream_size/4);
-    init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
-
-    f->wordstream= (const uint16_t*)(buf + extra + bitstream_size);
-    f->bytestream= buf + extra + bitstream_size + wordstream_size;
-
-    init_mv(f);
-
-    for(y=0; y<height; y+=8){
-        for(x=0; x<width; x+=8){
-            decode_p_block(f, dst + x, src + x, 3, 3, stride);
-        }
-        src += 8*stride;
-        dst += 8*stride;
-    }
-
-    if(   bitstream_size != (get_bits_count(&f->gb)+31)/32*4
-       || (((const char*)f->wordstream - (const char*)buf + 2)&~2) != extra + 
bitstream_size + wordstream_size
-       || (((const char*)f->bytestream - (const char*)buf + 3)&~3) != extra + 
bitstream_size + wordstream_size + bytestream_size)
-        av_log(f->avctx, AV_LOG_ERROR, " %d %td %td bytes left\n",
-            bitstream_size - (get_bits_count(&f->gb)+31)/32*4,
-            -(((const char*)f->bytestream - (const char*)buf + 3)&~3) + (extra 
+ bitstream_size + wordstream_size + bytestream_size),
-            -(((const char*)f->wordstream - (const char*)buf + 2)&~2) + (extra 
+ bitstream_size + wordstream_size)
-        );
-
-    return 0;
-}
-
-/**
- * decode block and dequantize.
- * Note this is almost identical to MJPEG.
- */
-static int decode_i_block(FourXContext *f, DCTELEM *block){
-    int code, i, j, level, val;
-
-    /* DC coef */
-    val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
-    if (val>>4){
-        av_log(f->avctx, AV_LOG_ERROR, "error dc run != 0\n");
-    }
-
-    if(val)
-        val = get_xbits(&f->gb, val);
-
-    val = val * dequant_table[0] + f->last_dc;
-    f->last_dc =
-    block[0] = val;
-    /* AC coefs */
-    i = 1;
-    for(;;) {
-        code = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
-
-        /* EOB */
-        if (code == 0)
-            break;
-        if (code == 0xf0) {
-            i += 16;
-        } else {
-            level = get_xbits(&f->gb, code & 0xf);
-            i += code >> 4;
-            if (i >= 64) {
-                av_log(f->avctx, AV_LOG_ERROR, "run %d oveflow\n", i);
-                return 0;
-            }
-
-            j= ff_zigzag_direct[i];
-            block[j] = level * dequant_table[j];
-            i++;
-            if (i >= 64)
-                break;
-        }
-    }
-
-    return 0;
-}
-
-static inline void idct_put(FourXContext *f, int x, int y){
-    DCTELEM (*block)[64]= f->block;
-    int stride= f->current_picture.linesize[0]>>1;
-    int i;
-    uint16_t *dst = ((uint16_t*)f->current_picture.data[0]) + y * stride + x;
-
-    for(i=0; i<4; i++){
-        block[i][0] += 0x80*8*8;
-        idct(block[i]);
-    }
-
-    if(!(f->avctx->flags&CODEC_FLAG_GRAY)){
-        for(i=4; i<6; i++) idct(block[i]);
-    }
-
-/* Note transform is:
-y= ( 1b + 4g + 2r)/14
-cb=( 3b - 2g - 1r)/14
-cr=(-1b - 4g + 5r)/14
-*/
-    for(y=0; y<8; y++){
-        for(x=0; x<8; x++){
-            DCTELEM *temp= block[(x>>2) + 2*(y>>2)] + 2*(x&3) + 2*8*(y&3); 
//FIXME optimize
-            int cb= block[4][x + 8*y];
-            int cr= block[5][x + 8*y];
-            int cg= (cb + cr)>>1;
-            int y;
-
-            cb+=cb;
-
-            y = temp[0];
-            dst[0       ]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + 
(((y+cr)&0xF8)<<8);
-            y = temp[1];
-            dst[1       ]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + 
(((y+cr)&0xF8)<<8);
-            y = temp[8];
-            dst[  stride]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + 
(((y+cr)&0xF8)<<8);
-            y = temp[9];
-            dst[1+stride]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + 
(((y+cr)&0xF8)<<8);
-            dst += 2;
-        }
-        dst += 2*stride - 2*8;
-    }
-}
-
-static int decode_i_mb(FourXContext *f){
-    int i;
-
-    f->dsp.clear_blocks(f->block[0]);
-
-    for(i=0; i<6; i++){
-        if(decode_i_block(f, f->block[i]) < 0)
-            return -1;
-    }
-
-    return 0;
-}
-
-static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * 
const buf){
-    int frequency[512];
-    uint8_t flag[512];
-    int up[512];
-    uint8_t len_tab[257];
-    int bits_tab[257];
-    int start, end;
-    const uint8_t *ptr= buf;
-    int j;
-
-    memset(frequency, 0, sizeof(frequency));
-    memset(up, -1, sizeof(up));
-
-    start= *ptr++;
-    end= *ptr++;
-    for(;;){
-        int i;
-
-        for(i=start; i<=end; i++){
-            frequency[i]= *ptr++;
-        }
-        start= *ptr++;
-        if(start==0) break;
-
-        end= *ptr++;
-    }
-    frequency[256]=1;
-
-    while((ptr - buf)&3) ptr++; // 4byte align
-
-    for(j=257; j<512; j++){
-        int min_freq[2]= {256*256, 256*256};
-        int smallest[2]= {0, 0};
-        int i;
-        for(i=0; i<j; i++){
-            if(frequency[i] == 0) continue;
-            if(frequency[i] < min_freq[1]){
-                if(frequency[i] < min_freq[0]){
-                    min_freq[1]= min_freq[0]; smallest[1]= smallest[0];
-                    min_freq[0]= frequency[i];smallest[0]= i;
-                }else{
-                    min_freq[1]= frequency[i];smallest[1]= i;
-                }
-            }
-        }
-        if(min_freq[1] == 256*256) break;
-
-        frequency[j]= min_freq[0] + min_freq[1];
-        flag[ smallest[0] ]= 0;
-        flag[ smallest[1] ]= 1;
-        up[ smallest[0] ]=
-        up[ smallest[1] ]= j;
-        frequency[ smallest[0] ]= frequency[ smallest[1] ]= 0;
-    }
-
-    for(j=0; j<257; j++){
-        int node;
-        int len=0;
-        int bits=0;
-
-        for(node= j; up[node] != -1; node= up[node]){
-            bits += flag[node]<<len;
-            len++;
-            if(len > 31) av_log(f->avctx, AV_LOG_ERROR, "vlc length 
overflow\n"); //can this happen at all ?
-        }
-
-        bits_tab[j]= bits;
-        len_tab[j]= len;
-    }
-
-    init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
-             len_tab , 1, 1,
-             bits_tab, 4, 4, 0);
-
-    return ptr;
-}
-
-static int mix(int c0, int c1){
-    int blue = 2*(c0&0x001F) + (c1&0x001F);
-    int green= (2*(c0&0x03E0) + (c1&0x03E0))>>5;
-    int red  = 2*(c0>>10) + (c1>>10);
-    return red/3*1024 + green/3*32 + blue/3;
-}
-
-static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length){
-    int x, y, x2, y2;
-    const int width= f->avctx->width;
-    const int height= f->avctx->height;
-    uint16_t *dst= (uint16_t*)f->current_picture.data[0];
-    const int stride= f->current_picture.linesize[0]>>1;
-
-    for(y=0; y<height; y+=16){
-        for(x=0; x<width; x+=16){
-            unsigned int color[4], bits;
-            memset(color, 0, sizeof(color));
-//warning following is purely guessed ...
-            color[0]= bytestream_get_le16(&buf);
-            color[1]= bytestream_get_le16(&buf);
-
-            if(color[0]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 1\n");
-            if(color[1]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 2\n");
-
-            color[2]= mix(color[0], color[1]);
-            color[3]= mix(color[1], color[0]);
-
-            bits= bytestream_get_le32(&buf);
-            for(y2=0; y2<16; y2++){
-                for(x2=0; x2<16; x2++){
-                    int index= 2*(x2>>2) + 8*(y2>>2);
-                    dst[y2*stride+x2]= color[(bits>>index)&3];
-                }
-            }
-            dst+=16;
-        }
-        dst += 16*stride - width;
-    }
-
-    return 0;
-}
-
-static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
-    int x, y;
-    const int width= f->avctx->width;
-    const int height= f->avctx->height;
-    uint16_t *dst= (uint16_t*)f->current_picture.data[0];
-    const int stride= f->current_picture.linesize[0]>>1;
-    const unsigned int bitstream_size= AV_RL32(buf);
-    const int token_count av_unused = AV_RL32(buf + bitstream_size + 8);
-    unsigned int prestream_size= 4*AV_RL32(buf + bitstream_size + 4);
-    const uint8_t *prestream= buf + bitstream_size + 12;
-
-    if(prestream_size + bitstream_size + 12 != length
-       || bitstream_size > (1<<26)
-       || prestream_size > (1<<26)){
-        av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n", 
prestream_size, bitstream_size, length);
-        return -1;
-    }
-
-    prestream= read_huffman_tables(f, prestream);
-
-    init_get_bits(&f->gb, buf + 4, 8*bitstream_size);
-
-    prestream_size= length + buf - prestream;
-
-    av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size, 
prestream_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!f->bitstream_buffer)
-        return AVERROR(ENOMEM);
-    f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream, 
prestream_size/4);
-    init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
-
-    f->last_dc= 0*128*8*8;
-
-    for(y=0; y<height; y+=16){
-        for(x=0; x<width; x+=16){
-            if(decode_i_mb(f) < 0)
-                return -1;
-
-            idct_put(f, x, y);
-        }
-        dst += 16*stride;
-    }
-
-    if(get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3) != 256)
-        av_log(f->avctx, AV_LOG_ERROR, "end mismatch\n");
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *data_size,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    FourXContext * const f = avctx->priv_data;
-    AVFrame *picture = data;
-    AVFrame *p, temp;
-    int i, frame_4cc, frame_size;
-
-    frame_4cc= AV_RL32(buf);
-    if(buf_size != AV_RL32(buf+4)+8 || buf_size < 20){
-        av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n", buf_size, 
AV_RL32(buf+4));
-    }
-
-    if(frame_4cc == AV_RL32("cfrm")){
-        int free_index=-1;
-        const int data_size= buf_size - 20;
-        const int id= AV_RL32(buf+12);
-        const int whole_size= AV_RL32(buf+16);
-        CFrameBuffer *cfrm;
-
-        for(i=0; i<CFRAME_BUFFER_COUNT; i++){
-            if(f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
-                av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", 
f->cfrm[i].id);
-        }
-
-        for(i=0; i<CFRAME_BUFFER_COUNT; i++){
-            if(f->cfrm[i].id   == id) break;
-            if(f->cfrm[i].size == 0 ) free_index= i;
-        }
-
-        if(i>=CFRAME_BUFFER_COUNT){
-            i= free_index;
-            f->cfrm[i].id= id;
-        }
-        cfrm= &f->cfrm[i];
-
-        cfrm->data= av_fast_realloc(cfrm->data, &cfrm->allocated_size, 
cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
-        if(!cfrm->data){ //explicit check needed as memcpy below might not 
catch a NULL
-            av_log(f->avctx, AV_LOG_ERROR, "realloc falure");
-            return -1;
-        }
-
-        memcpy(cfrm->data + cfrm->size, buf+20, data_size);
-        cfrm->size += data_size;
-
-        if(cfrm->size >= whole_size){
-            buf= cfrm->data;
-            frame_size= cfrm->size;
-
-            if(id != avctx->frame_number){
-                av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n", 
id, avctx->frame_number);
-            }
-
-            cfrm->size= cfrm->id= 0;
-            frame_4cc= AV_RL32("pfrm");
-        }else
-            return buf_size;
-    }else{
-        buf= buf + 12;
-        frame_size= buf_size - 12;
-    }
-
-    temp= f->current_picture;
-    f->current_picture= f->last_picture;
-    f->last_picture= temp;
-
-    p= &f->current_picture;
-    avctx->coded_frame= p;
-
-    avctx->flags |= CODEC_FLAG_EMU_EDGE; // alternatively we would have to use 
our own buffer management
-
-    if(p->data[0])
-        avctx->release_buffer(avctx, p);
-
-    p->reference= 1;
-    if(avctx->get_buffer(avctx, p) < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
-
-    if(frame_4cc == AV_RL32("ifr2")){
-        p->pict_type= FF_I_TYPE;
-        if(decode_i2_frame(f, buf-4, frame_size) < 0)
-            return -1;
-    }else if(frame_4cc == AV_RL32("ifrm")){
-        p->pict_type= FF_I_TYPE;
-        if(decode_i_frame(f, buf, frame_size) < 0)
-            return -1;
-    }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
-        p->pict_type= FF_P_TYPE;
-        if(decode_p_frame(f, buf, frame_size) < 0)
-            return -1;
-    }else if(frame_4cc == AV_RL32("snd_")){
-        av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n", 
buf_size);
-    }else{
-        av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n", 
buf_size);
-    }
-
-    p->key_frame= p->pict_type == FF_I_TYPE;
-
-    *picture= *p;
-    *data_size = sizeof(AVPicture);
-
-    emms_c();
-
-    return buf_size;
-}
-
-
-static av_cold void common_init(AVCodecContext *avctx){
-    FourXContext * const f = avctx->priv_data;
-
-    dsputil_init(&f->dsp, avctx);
-
-    f->avctx= avctx;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx){
-    FourXContext * const f = avctx->priv_data;
-
-    if(avctx->extradata_size != 4 || !avctx->extradata) {
-        av_log(avctx, AV_LOG_ERROR, "extradata wrong or missing\n");
-        return 1;
-    }
-
-    f->version= AV_RL32(avctx->extradata)>>16;
-    common_init(avctx);
-    init_vlcs(f);
-
-    if(f->version>2) avctx->pix_fmt= PIX_FMT_RGB565;
-    else             avctx->pix_fmt= PIX_FMT_BGR555;
-
-    return 0;
-}
-
-
-static av_cold int decode_end(AVCodecContext *avctx){
-    FourXContext * const f = avctx->priv_data;
-    int i;
-
-    av_freep(&f->bitstream_buffer);
-    f->bitstream_buffer_size=0;
-    for(i=0; i<CFRAME_BUFFER_COUNT; i++){
-        av_freep(&f->cfrm[i].data);
-        f->cfrm[i].allocated_size= 0;
-    }
-    free_vlc(&f->pre_vlc);
-    if(f->current_picture.data[0])
-        avctx->release_buffer(avctx, &f->current_picture);
-    if(f->last_picture.data[0])
-        avctx->release_buffer(avctx, &f->last_picture);
-
-    return 0;
-}
-
-AVCodec fourxm_decoder = {
-    "4xm",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_4XM,
-    sizeof(FourXContext),
-    decode_init,
-    NULL,
-    decode_end,
-    decode_frame,
-    CODEC_CAP_DR1,
-    .long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
-};
-
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/8bps.c 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/8bps.c
deleted file mode 100644
index ff57955..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/8bps.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Quicktime Planar RGB (8BPS) Video Decoder
- * Copyright (C) 2003 Roberto Togni
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QT 8BPS Video Decoder by Roberto Togni
- * For more information about the 8BPS format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *
- * Supports: PAL8 (RGB 8bpp, paletted)
- *         : BGR24 (RGB 24bpp) (can also output it as RGB32)
- *         : RGB32 (RGB 32bpp, 4th plane is probably alpha and it's ignored)
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-
-
-static const enum PixelFormat pixfmt_rgb24[] = {PIX_FMT_BGR24, PIX_FMT_RGB32, 
PIX_FMT_NONE};
-
-/*
- * Decoder context
- */
-typedef struct EightBpsContext {
-
-        AVCodecContext *avctx;
-        AVFrame pic;
-
-        unsigned char planes;
-        unsigned char planemap[4];
-} EightBpsContext;
-
-
-/*
- *
- * Decode a frame
- *
- */
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, 
AVPacket *avpkt)
-{
-        const uint8_t *buf = avpkt->data;
-        int buf_size = avpkt->size;
-        EightBpsContext * const c = avctx->priv_data;
-        const unsigned char *encoded = buf;
-        unsigned char *pixptr, *pixptr_end;
-        unsigned int height = avctx->height; // Real image height
-        unsigned int dlen, p, row;
-        const unsigned char *lp, *dp;
-        unsigned char count;
-        unsigned int px_inc;
-        unsigned int planes = c->planes;
-        unsigned char *planemap = c->planemap;
-
-        if(c->pic.data[0])
-                avctx->release_buffer(avctx, &c->pic);
-
-        c->pic.reference = 0;
-        c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
-        if(avctx->get_buffer(avctx, &c->pic) < 0){
-                av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                return -1;
-        }
-
-        /* Set data pointer after line lengths */
-        dp = encoded + planes * (height << 1);
-
-        /* Ignore alpha plane, don't know what to do with it */
-        if (planes == 4)
-                planes--;
-
-        px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32);
-
-        for (p = 0; p < planes; p++) {
-                /* Lines length pointer for this plane */
-                lp = encoded + p * (height << 1);
-
-                /* Decode a plane */
-                for(row = 0; row < height; row++) {
-                        pixptr = c->pic.data[0] + row * c->pic.linesize[0] + 
planemap[p];
-                        pixptr_end = pixptr + c->pic.linesize[0];
-                        dlen = be2me_16(*(const unsigned short *)(lp+row*2));
-                        /* Decode a row of this plane */
-                        while(dlen > 0) {
-                                if(dp + 1 >= buf+buf_size) return -1;
-                                if ((count = *dp++) <= 127) {
-                                        count++;
-                                        dlen -= count + 1;
-                                        if (pixptr + count * px_inc > 
pixptr_end)
-                                            break;
-                                        if(dp + count > buf+buf_size) return 
-1;
-                                        while(count--) {
-                                                *pixptr = *dp++;
-                                                pixptr += px_inc;
-                                        }
-                                } else {
-                                        count = 257 - count;
-                                        if (pixptr + count * px_inc > 
pixptr_end)
-                                            break;
-                                        while(count--) {
-                                                *pixptr = *dp;
-                                                pixptr += px_inc;
-                                        }
-                                        dp++;
-                                        dlen -= 2;
-                                }
-                        }
-                }
-        }
-
-        if (avctx->palctrl) {
-                memcpy (c->pic.data[1], avctx->palctrl->palette, 
AVPALETTE_SIZE);
-                if (avctx->palctrl->palette_changed) {
-                        c->pic.palette_has_changed = 1;
-                        avctx->palctrl->palette_changed = 0;
-                } else
-                        c->pic.palette_has_changed = 0;
-        }
-
-        *data_size = sizeof(AVFrame);
-        *(AVFrame*)data = c->pic;
-
-        /* always report that the buffer was completely consumed */
-        return buf_size;
-}
-
-
-/*
- *
- * Init 8BPS decoder
- *
- */
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-        EightBpsContext * const c = avctx->priv_data;
-
-        c->avctx = avctx;
-
-        c->pic.data[0] = NULL;
-
-        switch (avctx->bits_per_coded_sample) {
-                case 8:
-                        avctx->pix_fmt = PIX_FMT_PAL8;
-                        c->planes = 1;
-                        c->planemap[0] = 0; // 1st plane is palette indexes
-                        if (avctx->palctrl == NULL) {
-                                av_log(avctx, AV_LOG_ERROR, "Error: PAL8 
format but no palette from demuxer.\n");
-                                return -1;
-                        }
-                        break;
-                case 24:
-                        avctx->pix_fmt = avctx->get_format(avctx, 
pixfmt_rgb24);
-                        c->planes = 3;
-                        c->planemap[0] = 2; // 1st plane is red
-                        c->planemap[1] = 1; // 2nd plane is green
-                        c->planemap[2] = 0; // 3rd plane is blue
-                        break;
-                case 32:
-                        avctx->pix_fmt = PIX_FMT_RGB32;
-                        c->planes = 4;
-#if HAVE_BIGENDIAN
-                        c->planemap[0] = 1; // 1st plane is red
-                        c->planemap[1] = 2; // 2nd plane is green
-                        c->planemap[2] = 3; // 3rd plane is blue
-                        c->planemap[3] = 0; // 4th plane is alpha???
-#else
-                        c->planemap[0] = 2; // 1st plane is red
-                        c->planemap[1] = 1; // 2nd plane is green
-                        c->planemap[2] = 0; // 3rd plane is blue
-                        c->planemap[3] = 3; // 4th plane is alpha???
-#endif
-                        break;
-                default:
-                        av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color 
depth: %u.\n", avctx->bits_per_coded_sample);
-                        return -1;
-        }
-
-  return 0;
-}
-
-
-
-
-/*
- *
- * Uninit 8BPS decoder
- *
- */
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-        EightBpsContext * const c = avctx->priv_data;
-
-        if (c->pic.data[0])
-                avctx->release_buffer(avctx, &c->pic);
-
-        return 0;
-}
-
-
-
-AVCodec eightbps_decoder = {
-        "8bps",
-        AVMEDIA_TYPE_VIDEO,
-        CODEC_ID_8BPS,
-        sizeof(EightBpsContext),
-        decode_init,
-        NULL,
-        decode_end,
-        decode_frame,
-        CODEC_CAP_DR1,
-        .long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
-};
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/8svx.c 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/8svx.c
deleted file mode 100644
index 6e09b11..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/8svx.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 8SVX audio decoder
- * Copyright (C) 2008 Jaikrishnan Menon
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * 8svx audio decoder
- * @author Jaikrishnan Menon
- * supports: fibonacci delta encoding
- *         : exponential encoding
- */
-
-#include "avcodec.h"
-
-/** decoder context */
-typedef struct EightSvxContext {
-    int16_t fib_acc;
-    const int16_t *table;
-} EightSvxContext;
-
-static const int16_t fibonacci[16]   = { -34<<8, -21<<8, -13<<8,  -8<<8, 
-5<<8, -3<<8, -2<<8, -1<<8,
-                                          0, 1<<8, 2<<8, 3<<8, 5<<8, 8<<8, 
13<<8, 21<<8 };
-static const int16_t exponential[16] = { -128<<8, -64<<8, -32<<8, -16<<8, 
-8<<8, -4<<8, -2<<8, -1<<8,
-                                          0, 1<<8, 2<<8, 4<<8, 8<<8, 16<<8, 
32<<8, 64<<8 };
-
-/** decode a frame */
-static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int 
*data_size,
-                                 AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    EightSvxContext *esc = avctx->priv_data;
-    int16_t *out_data = data;
-    int consumed = buf_size;
-    const uint8_t *buf_end = buf + buf_size;
-
-    if((*data_size >> 2) < buf_size)
-        return -1;
-
-    if(avctx->frame_number == 0) {
-        esc->fib_acc = buf[1] << 8;
-        buf_size -= 2;
-        buf += 2;
-    }
-
-    *data_size = buf_size << 2;
-
-    while(buf < buf_end) {
-        uint8_t d = *buf++;
-        esc->fib_acc += esc->table[d & 0x0f];
-        *out_data++ = esc->fib_acc;
-        esc->fib_acc += esc->table[d >> 4];
-        *out_data++ = esc->fib_acc;
-    }
-
-    return consumed;
-}
-
-/** initialize 8svx decoder */
-static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
-{
-    EightSvxContext *esc = avctx->priv_data;
-
-    switch(avctx->codec->id) {
-        case CODEC_ID_8SVX_FIB:
-          esc->table = fibonacci;
-          break;
-        case CODEC_ID_8SVX_EXP:
-          esc->table = exponential;
-          break;
-        default:
-          return -1;
-    }
-    avctx->sample_fmt = SAMPLE_FMT_S16;
-    return 0;
-}
-
-AVCodec eightsvx_fib_decoder = {
-  .name           = "8svx_fib",
-  .type           = AVMEDIA_TYPE_AUDIO,
-  .id             = CODEC_ID_8SVX_FIB,
-  .priv_data_size = sizeof (EightSvxContext),
-  .init           = eightsvx_decode_init,
-  .decode         = eightsvx_decode_frame,
-  .long_name      = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
-};
-
-AVCodec eightsvx_exp_decoder = {
-  .name           = "8svx_exp",
-  .type           = AVMEDIA_TYPE_AUDIO,
-  .id             = CODEC_ID_8SVX_EXP,
-  .priv_data_size = sizeof (EightSvxContext),
-  .init           = eightsvx_decode_init,
-  .decode         = eightsvx_decode_frame,
-  .long_name      = NULL_IF_CONFIG_SMALL("8SVX exponential"),
-};
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile
deleted file mode 100644
index e54e955..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile
+++ /dev/null
@@ -1,392 +0,0 @@
-SubDir HAIKU_TOP src add-ons media plugins ffmpeg libavcodec ;
-
-SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ;
-SubDirHdrs [ FDirName $(SUBDIR) $(TARGET_ARCH) ] ;
-SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) libavutil ] ;
-SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) libswscale ] ;
-SubDirSysHdrs [ FDirName $(SUBDIR) $(DOTDOT) libogg include ] ;
-SubDirSysHdrs [ FDirName $(SUBDIR) $(DOTDOT) libtheora include ] ;
-SubDirSysHdrs [ FDirName $(SUBDIR) $(DOTDOT) libvorbis include ] ;
-SubDirSysHdrs [ FDirName $(SUBDIR) $(DOTDOT) libspeex include ] ;
-
-
-UseLibraryHeaders zlib ;
-
-# filter warnings we don't want here
-TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS)
-       : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ;
-
-# Some targets in this subdir fail to build with DEBUG=1
-DEBUG = 0 ;
-
-SubDirCcFlags $(HAIKU_FFMPEG_GCC_EXTRA_FLAGS) ;
-SubDirCcFlags $(HAIKU_FFMPEG_DEFINES) ;
-SubDirC++Flags $(HAIKU_FFMPEG_DEFINES) ;
-
-
-StaticLibrary libavcodec.a :
-       4xm.c
-       8bps.c
-       8svx.c
-       aac_ac3_parser.c
-       aac_adtstoasc_bsf.c
-       aac_parser.c
-       aaccoder.c
-       aacdec.c
-       aacenc.c
-       aacps.c
-       aacpsy.c
-       aacsbr.c
-       aactab.c
-       aandcttab.c
-       aasc.c
-       ac3.c
-       ac3_parser.c
-       ac3dec.c
-       ac3dec_data.c
-       ac3enc.c
-       ac3tab.c
-       acelp_filters.c
-       acelp_pitch_delay.c
-       acelp_vectors.c
-       adpcm.c
-       adxdec.c
-       alac.c
-       allcodecs.c
-       alsdec.c
-       amrnbdec.c
-       anm.c
-       apedec.c
-       asv1.c
-       atrac.c
-       atrac1.c
-       atrac3.c
-       audioconvert.c
-       aura.c
-       avfft.c
-       avpacket.c
-       avs.c
-       beosthread.c
-       bethsoftvideo.c
-       bgmc.c
-       bfi.c
-       bink.c
-       binkaudio.c
-       binkidct.c
-       bitstream.c
-       bitstream_filter.c
-       bmp.c
-       c93.c
-       cabac.c
-       cavs.c
-       cavs_parser.c
-       cavsdec.c
-       cavsdsp.c
-#      cbrt_tablegen.c
-       cdgraphics.c
-       celp_filters.c
-       celp_math.c
-       cinepak.c
-       cljr.c
-       cook.c
-#      costablegen.c
-       cscd.c
-       cyuv.c
-       dca.c
-       dca_parser.c
-       dcadsp.c
-       dct.c
-       dirac.c
-       dirac_parser.c
-       dnxhd_parser.c
-       dnxhddata.c
-       dnxhddec.c
-       dpcm.c
-       dsicinav.c
-       dsputil.c
-       dump_extradata_bsf.c
-       dv.c
-#      dv_tablegen.c
-       dvbsub.c
-       dvbsub_parser.c
-       dvbsubdec.c
-       dvdata.c
-       dvdsub_parser.c
-       dvdsubdec.c
-       dwt.c
-       dxa.c
-#      dxva2.c
-#      dxva2_h264.c
-#      dxva2_vc1.c
-       eac3dec.c
-       eac3dec_data.c
-       eacmv.c
-       eaidct.c
-       eatgq.c
-       eatgv.c
-       eatqi.c
-       elbg.c
-       error_resilience.c
-       escape124.c
-       eval.c
-       faandct.c
-       faanidct.c
-       faxcompr.c
-#      fdctref.c # GPL, only used for DCT test program
-       fft.c
-       ffv1.c
-       flac.c
-       flacdata.c
-       flacdec.c
-       flacenc.c
-       flashsv.c
-       flicvideo.c
-       flvenc.c
-       flvdec.c
-       fraps.c
-       frwu.c
-       g726.c
-#      g729dec.c
-       gif.c
-       gifdec.c
-       golomb.c
-       h261.c
-       h261_parser.c
-       h261dec.c
-       h263.c
-       h263_parser.c
-       h263dec.c
-       h264.c
-       h264_cabac.c
-       h264_cavlc.c
-       h264_direct.c
-       h264_loopfilter.c
-       h264_mp4toannexb_bsf.c
-       h264_parser.c
-       h264_ps.c
-       h264_refs.c
-       h264_sei.c
-       h264dsp.c
-#      h264dspenc.c
-       h264idct.c
-       h264pred.c
-       huffman.c
-       huffyuv.c
-       idcinvideo.c
-       iff.c
-       iirfilter.c
-       imc.c
-       imgconvert.c
-       imx_dump_header_bsf.c
-       indeo2.c
-       indeo3.c
-       indeo5.c
-       intelh263dec.c
-       interplayvideo.c
-       intrax8.c
-       intrax8dsp.c
-       ituh263dec.c
-       ituh263enc.c
-       ivi_common.c
-       ivi_dsp.c
-       jfdctfst.c
-       jfdctint.c
-       jpegls.c
-       jpeglsdec.c
-       jrevdct.c
-       kgv1dec.c
-       kmvc.c
-       lcldec.c
-#      lclenc.c
-       libspeexdec.c
-       libtheoraenc.c
-       libvorbis.c
-#      ljpegenc.c
-       loco.c
-       lpc.c
-       lsp.c
-       lzw.c
-#      lzwenc.c
-       mace.c
-       mdct.c
-#      mdct_tablegen.c
-       mdec.c
-       mimic.c
-       mjpeg.c
-       mjpeg_parser.c
-       mjpega_dump_header_bsf.c
-       mjpegbdec.c
-       mjpegdec.c
-       mjpegenc.c
-       mlp.c
-       mlp_parser.c
-       mlpdec.c
-       mlpdsp.c
-       mmvideo.c
-       motion_est.c
-       motionpixels.c
-#      motionpixels_tablegen.c
-       movsub_bsf.c
-       mp3_header_compress_bsf.c
-       mp3_header_decompress_bsf.c
-       mpc.c
-       mpc7.c
-       mpc8.c
-       mpeg4audio.c
-       mpeg4video.c
-       mpeg4video_parser.c
-       mpeg4videoenc.c
-       mpeg4videodec.c
-       mpeg12.c
-       mpeg12data.c
-       mpeg12enc.c
-       mpegaudio.c
-       mpegaudio_parser.c
-#      mpegaudio_tablegen.c
-       mpegaudiodata.c
-       mpegaudiodec.c
-       mpegaudiodecheader.c
-       mpegaudioenc.c
-       mpegvideo.c
-       mpegvideo_enc.c
-       mpegvideo_parser.c
-#      mpegvideo_xvmc.c
-       msmpeg4.c
-       msmpeg4data.c
-       msrle.c
-       msrledec.c
-       msvideo1.c
-       nellymoser.c
-       nellymoserdec.c
-       noise_bsf.c
-       nuv.c
-       opt.c
-       options.c
-       pamenc.c
-       parser.c
-       pcm.c
-       pcm-mpeg.c
-#      pcm_tablegen.c
-       pcx.c
-       pgssubdec.c
-       png.c
-       pngdec.c
-       pnm.c
-       pnm_parser.c
-       pnmdec.c
-#      pnmenc.c
-       psymodel.c
-       pthread.c
-       ptx.c
-       qcelpdec.c
-       qdm2.c
-#      qdm2_tablegen.c
-       qdrw.c
-       qpeg.c
-       qtrle.c
-       r210dec.c
-       ra144.c
-       ra288.c
-       rangecoder.c
-       ratecontrol.c
-       raw.c
-       rawdec.c
-       rawenc.c
-       rdft.c
-       remove_extradata_bsf.c
-       resample.c
-       resample2.c
-       rl2.c
-       rle.c
-#      roqaudioenc.c
-       roqvideo.c
-       roqvideodec.c
-#      roqvideoenc.c
-       rpza.c
-       rtjpeg.c
-       rv10.c
-       rv30.c
-       rv30dsp.c
-       rv34.c
-       rv40.c
-       rv40dsp.c
-       s3tc.c
-       sgidec.c
-       shorten.c
-       simple_idct.c
-       sipr.c
-       sipr16k.c
-       smacker.c
-       smc.c
-       snow.c
-       sonic.c
-       sp5xdec.c
-       sunrast.c
-       svq1.c
-       svq1dec.c
-       svq3.c
-       synth_filter.c
-       tableprint.c
-       targa.c
-       tiertexseqv.c
-       tiff.c
-#      tiffenc.c
-       truemotion1.c
-       truemotion2.c
-       truespeech.c
-       tscc.c
-       tta.c
-       twinvq.c
-       txd.c
-       ulti.c
-       utils.c
-#      vaapi_h264.c
-       vb.c
-       vc1.c
-       vc1dec.c
-       vc1_parser.c
-       vc1data.c
-       vc1dsp.c
-       vcr1.c
-       vmdav.c
-       vmnc.c
-       vorbis.c
-       vorbis_data.c
-       vorbis_dec.c
-       vp3.c
-       vp3_parser.c
-       vp3dsp.c
-       vp5.c
-       vp56.c
-       vp56data.c
-       vp56dsp.c
-       vp6.c
-       vp6dsp.c
-       vqavideo.c
-       wavpack.c
-       wma.c
-       wmadec.c
-       wmaprodec.c
-       wmavoice.c
-       wmv2.c
-       wmv2dec.c
-       wnv1.c
-       ws-snd1.c
-       xan.c
-       xiph.c
-       xl.c
-       xsubdec.c
-       yop.c
-       zmbv.c
-;
-
-# GCC2 needs this in order to find codec.h in each of these directories
-# respectively and to find the correct codec.h, we need to define this
-# per individual file.
-SourceHdrs libvorbis.c : [ FDirName $(SUBDIR) .. libvorbis include vorbis ] ;
-SourceHdrs libtheoraenc.c : [ FDirName $(SUBDIR) .. libtheora include theora ] 
;
-SourceHdrs libspeexdec.c : [ FDirName $(SUBDIR) .. libspeex include speex ] ;
-
-SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavcodec
-       $(TARGET_ARCH) ;
-
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac.h 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/aac.h
deleted file mode 100644
index 94f578f..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * AAC definitions and structures
- * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
- * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC definitions and structures
- * @author Oded Shimon  ( ods15 ods15 dyndns org )
- * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
- */
-
-#ifndef AVCODEC_AAC_H
-#define AVCODEC_AAC_H
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "fft.h"
-#include "mpeg4audio.h"
-#include "sbr.h"
-
-#include <stdint.h>
-
-#define MAX_CHANNELS 64
-#define MAX_ELEM_ID 16
-
-#define TNS_MAX_ORDER 20
-
-enum RawDataBlockType {
-    TYPE_SCE,
-    TYPE_CPE,
-    TYPE_CCE,
-    TYPE_LFE,
-    TYPE_DSE,
-    TYPE_PCE,
-    TYPE_FIL,
-    TYPE_END,
-};
-
-enum ExtensionPayloadID {
-    EXT_FILL,
-    EXT_FILL_DATA,
-    EXT_DATA_ELEMENT,
-    EXT_DYNAMIC_RANGE = 0xb,
-    EXT_SBR_DATA      = 0xd,
-    EXT_SBR_DATA_CRC  = 0xe,
-};
-
-enum WindowSequence {
-    ONLY_LONG_SEQUENCE,
-    LONG_START_SEQUENCE,
-    EIGHT_SHORT_SEQUENCE,
-    LONG_STOP_SEQUENCE,
-};
-
-enum BandType {
-    ZERO_BT        = 0,     ///< Scalefactors and spectral data are all zero.
-    FIRST_PAIR_BT  = 5,     ///< This and later band types encode two values 
(rather than four) with one code word.
-    ESC_BT         = 11,    ///< Spectral data are coded with an escape 
sequence.
-    NOISE_BT       = 13,    ///< Spectral data are scaled white noise not 
coded in the bitstream.
-    INTENSITY_BT2  = 14,    ///< Scalefactor data are intensity stereo 
positions.
-    INTENSITY_BT   = 15,    ///< Scalefactor data are intensity stereo 
positions.
-};
-
-#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
-
-enum ChannelPosition {
-    AAC_CHANNEL_FRONT = 1,
-    AAC_CHANNEL_SIDE  = 2,
-    AAC_CHANNEL_BACK  = 3,
-    AAC_CHANNEL_LFE   = 4,
-    AAC_CHANNEL_CC    = 5,
-};
-
-/**
- * The point during decoding at which channel coupling is applied.
- */
-enum CouplingPoint {
-    BEFORE_TNS,
-    BETWEEN_TNS_AND_IMDCT,
-    AFTER_IMDCT = 3,
-};
-
-/**
- * Output configuration status
- */
-enum OCStatus {
-    OC_NONE,        //< Output unconfigured
-    OC_TRIAL_PCE,   //< Output configuration under trial specified by an 
inband PCE
-    OC_TRIAL_FRAME, //< Output configuration under trial specified by a frame 
header
-    OC_GLOBAL_HDR,  //< Output configuration set in a global header but not 
yet locked
-    OC_LOCKED,      //< Output configuration locked in place
-};
-
-/**
- * Predictor State
- */
-typedef struct {
-    float cor0;
-    float cor1;
-    float var0;
-    float var1;
-    float r0;
-    float r1;
-} PredictorState;
-
-#define MAX_PREDICTORS 672
-
-#define SCALE_DIV_512    36    ///< scalefactor difference that corresponds to 
scale difference in 512 times
-#define SCALE_ONE_POS   140    ///< scalefactor index that corresponds to 
scale=1.0
-#define SCALE_MAX_POS   255    ///< scalefactor index maximum value
-#define SCALE_MAX_DIFF   60    ///< maximum scalefactor difference allowed by 
standard
-#define SCALE_DIFF_ZERO  60    ///< codebook index corresponding to zero 
scalefactor indices difference
-
-/**
- * Individual Channel Stream
- */
-typedef struct {
-    uint8_t max_sfb;            ///< number of scalefactor bands per group
-    enum WindowSequence window_sequence[2];
-    uint8_t use_kb_window[2];   ///< If set, use Kaiser-Bessel window, 
otherwise use a sinus window.
-    int num_window_groups;
-    uint8_t group_len[8];
-    const uint16_t *swb_offset; ///< table of offsets to the lowest spectral 
coefficient of a scalefactor band, sfb, for a particular window
-    const uint8_t *swb_sizes;   ///< table of scalefactor band sizes for a 
particular window
-    int num_swb;                ///< number of scalefactor window bands
-    int num_windows;
-    int tns_max_bands;
-    int predictor_present;
-    int predictor_initialized;
-    int predictor_reset_group;
-    uint8_t prediction_used[41];
-} IndividualChannelStream;
-
-/**
- * Temporal Noise Shaping
- */
-typedef struct {
-    int present;
-    int n_filt[8];
-    int length[8][4];
-    int direction[8][4];
-    int order[8][4];
-    float coef[8][4][TNS_MAX_ORDER];
-} TemporalNoiseShaping;
-
-/**
- * Dynamic Range Control - decoded from the bitstream but not processed 
further.
- */
-typedef struct {
-    int pce_instance_tag;                           ///< Indicates with which 
program the DRC info is associated.
-    int dyn_rng_sgn[17];                            ///< DRC sign information; 
0 - positive, 1 - negative
-    int dyn_rng_ctl[17];                            ///< DRC magnitude 
information
-    int exclude_mask[MAX_CHANNELS];                 ///< Channels to be 
excluded from DRC processing.
-    int band_incr;                                  ///< Number of DRC bands 
greater than 1 having DRC info.
-    int interpolation_scheme;                       ///< Indicates the 
interpolation scheme used in the SBR QMF domain.
-    int band_top[17];                               ///< Indicates the top of 
the i-th DRC band in units of 4 spectral lines.
-    int prog_ref_level;                             /**< A reference level for 
the long-term program audio level for all
-                                                     *   channels combined.
-                                                     */
-} DynamicRangeControl;
-
-typedef struct {
-    int num_pulse;
-    int start;
-    int pos[4];
-    int amp[4];
-} Pulse;
-
-/**
- * coupling parameters
- */
-typedef struct {
-    enum CouplingPoint coupling_point;  ///< The point during decoding at 
which coupling is applied.
-    int num_coupled;       ///< number of target elements
-    enum RawDataBlockType type[8];   ///< Type of channel element to be 
coupled - SCE or CPE.
-    int id_select[8];      ///< element id
-    int ch_select[8];      /**< [0] shared list of gains; [1] list of gains 
for right channel;
-                            *   [2] list of gains for left channel; [3] lists 
of gains for both channels
-                            */
-    float gain[16][120];
-} ChannelCoupling;
-
-/**
- * Single Channel Element - used for both SCE and LFE elements.
- */
-typedef struct {
-    IndividualChannelStream ics;
-    TemporalNoiseShaping tns;
-    Pulse pulse;
-    enum BandType band_type[128];             ///< band types
-    int band_type_run_end[120];               ///< band type run end points
-    float sf[120];                            ///< scalefactors
-    int sf_idx[128];                          ///< scalefactor indices (used 
by encoder)
-    uint8_t zeroes[128];                      ///< band is not coded (used by 
encoder)
-    DECLARE_ALIGNED(16, float, coeffs)[1024]; ///< coefficients for IMDCT
-    DECLARE_ALIGNED(16, float, saved)[1024];  ///< overlap
-    DECLARE_ALIGNED(16, float, ret)[2048];    ///< PCM output
-    PredictorState predictor_state[MAX_PREDICTORS];
-} SingleChannelElement;
-
-/**
- * channel element - generic struct for SCE/CPE/CCE/LFE
- */
-typedef struct {
-    // CPE specific
-    int common_window;        ///< Set if channels share a common 
'IndividualChannelStream' in bitstream.
-    int     ms_mode;          ///< Signals mid/side stereo flags coding mode 
(used by encoder)
-    uint8_t ms_mask[128];     ///< Set if mid/side stereo is used for each 
scalefactor window band
-    // shared
-    SingleChannelElement ch[2];
-    // CCE specific
-    ChannelCoupling coup;
-    SpectralBandReplication sbr;
-} ChannelElement;
-
-/**
- * main AAC context
- */
-typedef struct {
-    AVCodecContext *avctx;
-
-    MPEG4AudioConfig m4ac;
-
-    int is_saved;                 ///< Set if elements have stored overlap 
from previous frame.
-    DynamicRangeControl che_drc;
-
-    /**
-     * @defgroup elements Channel element related data.
-     * @{
-     */
-    enum ChannelPosition che_pos[4][MAX_ELEM_ID]; /**< channel element channel 
mapping with the
-                                                   *   first index as the 
first 4 raw data block types
-                                                   */
-    ChannelElement          *che[4][MAX_ELEM_ID];
-    ChannelElement  *tag_che_map[4][MAX_ELEM_ID];
-    uint8_t tags_seen_this_frame[4][MAX_ELEM_ID];
-    int tags_mapped;
-    /** @} */
-
-    /**
-     * @defgroup temporary aligned temporary buffers (We do not want to have 
these on the stack.)
-     * @{
-     */
-    DECLARE_ALIGNED(16, float, buf_mdct)[1024];
-    /** @} */
-
-    /**
-     * @defgroup tables   Computed / set up during initialization.
-     * @{
-     */
-    FFTContext mdct;
-    FFTContext mdct_small;
-    DSPContext dsp;
-    int random_state;
-    /** @} */
-
-    /**
-     * @defgroup output   Members used for output interleaving.
-     * @{
-     */
-    float *output_data[MAX_CHANNELS];                 ///< Points to each 
element's 'ret' buffer (PCM output).
-    float add_bias;                                   ///< offset for 
dsp.float_to_int16
-    float sf_scale;                                   ///< Pre-scale for 
correct IMDCT and dsp.float_to_int16.
-    int sf_offset;                                    ///< offset into 
pow2sf_tab as appropriate for dsp.float_to_int16
-    /** @} */
-
-    DECLARE_ALIGNED(16, float, temp)[128];
-
-    enum OCStatus output_configured;
-} AACContext;
-
-#endif /* AVCODEC_AAC_H */
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_ac3_parser.c 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_ac3_parser.c
deleted file mode 100644
index 8791161..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_ac3_parser.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Common AAC and AC-3 parser
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h"
-#include "aac_ac3_parser.h"
-
-int ff_aac_ac3_parse(AVCodecParserContext *s1,
-                     AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size)
-{
-    AACAC3ParseContext *s = s1->priv_data;
-    ParseContext *pc = &s->pc;
-    int len, i;
-    int new_frame_start;
-
-get_next:
-    i=END_NOT_FOUND;
-    if(s->remaining_size <= buf_size){
-        if(s->remaining_size && !s->need_next_header){
-            i= s->remaining_size;
-            s->remaining_size = 0;
-        }else{ //we need a header first
-            len=0;
-            for(i=s->remaining_size; i<buf_size; i++){
-                s->state = (s->state<<8) + buf[i];
-                if((len=s->sync(s->state, s, &s->need_next_header, 
&new_frame_start)))
-                    break;
-            }
-            if(len<=0){
-                i=END_NOT_FOUND;
-            }else{
-                s->state=0;
-                i-= s->header_size -1;
-                s->remaining_size = len;
-                if(!new_frame_start || pc->index+i<=0){
-                    s->remaining_size += i;
-                    goto get_next;
-                }
-            }
-        }
-    }
-
-    if(ff_combine_frame(pc, i, &buf, &buf_size)<0){
-        s->remaining_size -= FFMIN(s->remaining_size, buf_size);
-        *poutbuf = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
-    }
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-
-    /* update codec info */
-    if(s->codec_id)
-        avctx->codec_id = s->codec_id;
-
-    /* Due to backwards compatible HE-AAC the sample rate, channel count,
-       and total number of samples found in an AAC ADTS header are not
-       reliable. Bit rate is still accurate because the total frame duration in
-       seconds is still correct (as is the number of bits in the frame). */
-    if (avctx->codec_id != CODEC_ID_AAC) {
-        avctx->sample_rate = s->sample_rate;
-
-        /* allow downmixing to stereo (or mono for AC-3) */
-        if(avctx->request_channels > 0 &&
-                avctx->request_channels < s->channels &&
-                (avctx->request_channels <= 2 ||
-                (avctx->request_channels == 1 &&
-                (avctx->codec_id == CODEC_ID_AC3 ||
-                 avctx->codec_id == CODEC_ID_EAC3)))) {
-            avctx->channels = avctx->request_channels;
-        } else {
-            avctx->channels = s->channels;
-            avctx->channel_layout = s->channel_layout;
-        }
-        avctx->frame_size = s->samples;
-    }
-
-    avctx->bit_rate = s->bit_rate;
-
-    return i;
-}
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_ac3_parser.h 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_ac3_parser.h
deleted file mode 100644
index 75f6d4b..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_ac3_parser.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Common AAC and AC-3 parser prototypes
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AAC_AC3_PARSER_H
-#define AVCODEC_AAC_AC3_PARSER_H
-
-#include <stdint.h>
-#include "avcodec.h"
-#include "parser.h"
-
-typedef enum {
-    AAC_AC3_PARSE_ERROR_SYNC        = -1,
-    AAC_AC3_PARSE_ERROR_BSID        = -2,
-    AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -3,
-    AAC_AC3_PARSE_ERROR_FRAME_SIZE  = -4,
-    AAC_AC3_PARSE_ERROR_FRAME_TYPE  = -5,
-    AAC_AC3_PARSE_ERROR_CRC         = -6,
-    AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -7,
-} AACAC3ParseError;
-
-typedef struct AACAC3ParseContext {
-    ParseContext pc;
-    int frame_size;
-    int header_size;
-    int (*sync)(uint64_t state, struct AACAC3ParseContext *hdr_info,
-            int *need_next_header, int *new_frame_start);
-
-    int channels;
-    int sample_rate;
-    int bit_rate;
-    int samples;
-    int64_t channel_layout;
-
-    int remaining_size;
-    uint64_t state;
-
-    int need_next_header;
-    enum CodecID codec_id;
-} AACAC3ParseContext;
-
-int ff_aac_ac3_parse(AVCodecParserContext *s1,
-                     AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size);
-
-#endif /* AVCODEC_AAC_AC3_PARSER_H */
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_adtstoasc_bsf.c 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
deleted file mode 100644
index 9d53a01..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration bitstream filter
- * Copyright (c) 2009 Alex Converse <alex.converse@xxxxxxxxx>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "aac_parser.h"
-#include "put_bits.h"
-#include "get_bits.h"
-#include "mpeg4audio.h"
-#include "internal.h"
-
-typedef struct AACBSFContext {
-    int first_frame_done;
-} AACBSFContext;
-
-/**
- * This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
- * ADTS header and removes the ADTS header.
- */
-static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
-                                AVCodecContext *avctx, const char *args,
-                                uint8_t  **poutbuf, int *poutbuf_size,
-                                const uint8_t *buf, int      buf_size,
-                                int keyframe)
-{
-    GetBitContext gb;
-    PutBitContext pb;
-    AACADTSHeaderInfo hdr;
-
-    AACBSFContext *ctx = bsfc->priv_data;
-
-    init_get_bits(&gb, buf, AAC_ADTS_HEADER_SIZE*8);
-
-    *poutbuf = (uint8_t*) buf;
-    *poutbuf_size = buf_size;
-
-    if (avctx->extradata)
-        if (show_bits(&gb, 12) != 0xfff)
-            return 0;
-
-    if (ff_aac_parse_header(&gb, &hdr) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
-        return -1;
-    }
-
-    if (!hdr.crc_absent && hdr.num_aac_frames > 1) {
-        av_log_missing_feature(avctx, "Multiple RDBs per frame with CRC is", 
0);
-        return -1;
-    }
-
-    buf      += AAC_ADTS_HEADER_SIZE + 2*!hdr.crc_absent;
-    buf_size -= AAC_ADTS_HEADER_SIZE + 2*!hdr.crc_absent;
-
-    if (!ctx->first_frame_done) {
-        int            pce_size = 0;
-        uint8_t        pce_data[MAX_PCE_SIZE];
-        if (!hdr.chan_config) {
-            init_get_bits(&gb, buf, buf_size);
-            if (get_bits(&gb, 3) != 5) {
-                av_log_missing_feature(avctx, "PCE based channel 
configuration, where the PCE is not the first syntax element is", 0);
-                return -1;
-            }
-            init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
-            pce_size = ff_copy_pce_data(&pb, &gb)/8;
-            flush_put_bits(&pb);
-            buf_size -= get_bits_count(&gb)/8;
-            buf      += get_bits_count(&gb)/8;
-        }
-        avctx->extradata_size = 2 + pce_size;
-        avctx->extradata = av_mallocz(avctx->extradata_size + 
FF_INPUT_BUFFER_PADDING_SIZE);
-
-        init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
-        put_bits(&pb, 5, hdr.object_type);
-        put_bits(&pb, 4, hdr.sampling_index);
-        put_bits(&pb, 4, hdr.chan_config);
-        put_bits(&pb, 1, 0); //frame length - 1024 samples
-        put_bits(&pb, 1, 0); //does not depend on core coder
-        put_bits(&pb, 1, 0); //is not extension
-        flush_put_bits(&pb);
-        if (pce_size) {
-            memcpy(avctx->extradata + 2, pce_data, pce_size);
-        }
-
-        ctx->first_frame_done = 1;
-    }
-
-    *poutbuf = (uint8_t*) buf;
-    *poutbuf_size = buf_size;
-
-    return 0;
-}
-
-AVBitStreamFilter aac_adtstoasc_bsf = {
-    "aac_adtstoasc",
-    sizeof(AACBSFContext),
-    aac_adtstoasc_filter,
-};
diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_parser.c 
b/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_parser.c
deleted file mode 100644
index 30ce04d..0000000
--- a/src/add-ons/media/plugins/ffmpeg/libavcodec/aac_parser.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Audio and Video frame extraction
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h"
-#include "aac_ac3_parser.h"
-#include "aac_parser.h"
-#include "get_bits.h"
-#include "mpeg4audio.h"
-
-int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
-{
-    int size, rdb, ch, sr;
-    int aot, crc_abs;
-
-    if(get_bits(gbc, 12) != 0xfff)
-        return AAC_AC3_PARSE_ERROR_SYNC;
-
-    skip_bits1(gbc);             /* id */
-    skip_bits(gbc, 2);           /* layer */
-    crc_abs = get_bits1(gbc);    /* protection_absent */
-    aot     = get_bits(gbc, 2);  /* profile_objecttype */
-    sr      = get_bits(gbc, 4);  /* sample_frequency_index */
-    if(!ff_mpeg4audio_sample_rates[sr])
-        return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;
-    skip_bits1(gbc);             /* private_bit */
-    ch      = get_bits(gbc, 3);  /* channel_configuration */
-
-    skip_bits1(gbc);             /* original/copy */
-    skip_bits1(gbc);             /* home */
-
-    /* adts_variable_header */
-    skip_bits1(gbc);             /* copyright_identification_bit */
-    skip_bits1(gbc);             /* copyright_identification_start */
-    size    = get_bits(gbc, 13); /* aac_frame_length */
-    if(size < AAC_ADTS_HEADER_SIZE)
-        return AAC_AC3_PARSE_ERROR_FRAME_SIZE;
-
-    skip_bits(gbc, 11);          /* adts_buffer_fullness */
-    rdb = get_bits(gbc, 2);      /* number_of_raw_data_blocks_in_frame */
-
-    hdr->object_type    = aot + 1;
-    hdr->chan_config    = ch;
-    hdr->crc_absent     = crc_abs;
-    hdr->num_aac_frames = rdb + 1;
-    hdr->sampling_index = sr;
-    hdr->sample_rate    = ff_mpeg4audio_sample_rates[sr];
-    hdr->samples        = (rdb + 1) * 1024;
-    hdr->bit_rate       = size * 8 * hdr->sample_rate / hdr->samples;
-
-    return size;
-}
-
-static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
-        int *need_next_header, int *new_frame_start)
-{
-    GetBitContext bits;
-    AACADTSHeaderInfo hdr;
-    int size;
-    union {
-        uint64_t u64;
-        uint8_t  u8[8];
-    } tmp;
-
-    tmp.u64 = be2me_64(state);
-    init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 
8);
-
-    if ((size = ff_aac_parse_header(&bits, &hdr)) < 0)
-        return 0;
-    *need_next_header = 0;
-    *new_frame_start  = 1;
-    hdr_info->sample_rate = hdr.sample_rate;
-    hdr_info->channels    = ff_mpeg4audio_channels[hdr.chan_config];
-    hdr_info->samples     = hdr.samples;
-    hdr_info->bit_rate    = hdr.bit_rate;

[ *** diff truncated: 431105 lines dropped *** ]


############################################################################

Revision:    hrev43830
Commit:      7007402957f67a3ccd2698399634af182dd19cc0
URL:         http://cgit.haiku-os.org/haiku/commit/?id=7007402
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Wed Mar  7 01:02:59 2012 UTC

DVB: add a dependency on FFMpeg optional package

* MediaFormat.cpp includes avcodec.h from libavcodec without actually
  using the library.

----------------------------------------------------------------------------


Other related posts: