<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.video.ffmpeg.devel">
    <title>gmane.comp.video.ffmpeg.devel</title>
    <link>http://blog.gmane.org/gmane.comp.video.ffmpeg.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164162"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164161"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164160"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164159"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164158"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164157"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164156"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164155"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164154"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164153"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164152"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164151"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164150"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164149"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164148"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164147"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164146"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164145"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164144"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164143"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164162">
    <title>[PATCH] lavfi: simplify link dependencies.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164162</link>
    <description>&lt;pre&gt;This avoids re-declaring the filter dependencies. Also, it fixes the
optional dependencies: for instance the select filter having an optional
dependency on avcodec.
---
 libavfilter/Makefile | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 6cc2930..2897f49 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2,23 +2,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; include $(SUBDIR)../config.mak
 
 NAME = avfilter
 FFLIBS = avutil
-FFLIBS-$(CONFIG_ACONVERT_FILTER)             += swresample
-FFLIBS-$(CONFIG_AMOVIE_FILTER)               += avformat avcodec
-FFLIBS-$(CONFIG_ARESAMPLE_FILTER)            += swresample
-FFLIBS-$(CONFIG_ASYNCTS_FILTER)              += avresample
-FFLIBS-$(CONFIG_ATEMPO_FILTER)               += avcodec
-FFLIBS-$(CONFIG_DECIMATE_FILTER)             += avcodec
-FFLIBS-$(CONFIG_DESHAKE_FILTER)              += avcodec
-FFLIBS-$(CONFIG_MOVIE_FILTER)                += avformat avcodec
-FFLIBS-$(CONFIG_MP_FILTER)                   += avcodec
-FFLIBS-$(CONFIG_PAN_FILTER)                  += swresample
-FFLIBS-$(CONFIG_PP_FILTER)                   += postproc
-FFLIBS-$(CONFIG_REMOVELOGO_FILTER)           += avformat avcodec swscale
-FFLIBS-$(CONFIG_RESAMPLE_FILTER)             += avresample
-FFLIBS-$(CONFIG_SCALE_FILTER)                += swscale
-FFLIBS-$(CONFIG_SHOWSPECTRUM_FILTER)         += avcodec
-FFLIBS-$(CONFIG_SMARTBLUR_FILTER)            += swscale
-FFLIBS-$(CONFIG_SUBTITLES_FILTER)            += avformat avcodec
+FFLIBS-$(CONFIG_AVCODEC)    += avcodec
+FFLIBS-$(CONFIG_AVFORMAT)   += avformat
+FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
+FFLIBS-$(CONFIG_POSTPROC)   += postproc
+FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
+FFLIBS-$(CONFIG_SWSCALE)    += swscale
 
 HEADERS = asrc_abuffer.h                                                \
           avcodec.h                                                     \
&lt;/pre&gt;</description>
    <dc:creator>Clément Bœsch</dc:creator>
    <dc:date>2013-05-22T17:38:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164161">
    <title>racing video any compiling suggestions?</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164161</link>
    <description>&lt;pre&gt;   I've got an x86_64 (3-core x 4Ghz) AMD system with Radeon video chip 
and just lately, since my last local compiling version 1.2.1 on Arch 
Linux, I have been having difficulty with some serious timing issues. 
|ffplay| seems to drift ahead by .1 to .5 seconds in the video, so the 
sound comes too late.  I've been trying with |ffmpeg| to utilize the 
schroedinger codec, and had some sporatic success a few times at first, 
but from then since the schro/dirac codec has been racing so far ahead 
of the audio that one can actually see the video going too fast in the 
resulting video.

   I have written a bunch of scripts around the new ffmpeg release, and 
I want to maximize use of the gradually progressing support for 
schroedinger/dirac as well as opus, so how to deal with this seems to be 
a either a matter to bring development focus to, or ask help resolving 
from my end.  Does anyone have a similar experience? Could there be a 
way to work around it at the compiling stage?


|ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers||
||  built on May 21 2013 11:46:35 with gcc 4.8.0 (GCC) 20130502 
(prerelease)||
||  configuration: --prefix=/usr --disable-debug --disable-static 
--enable-avresample --enable-dxva2 --enable-fontconfig --enable-gpl 
--enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm 
--enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb 
--enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus 
--enable-libpulse --enable-librtmp --enable-libschroedinger 
--enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvorbis 
--enable-libvpx --enable-libx264 --enable-libxvid --enable-postproc 
--enable-runtime-cpudetect --enable-shared --enable-vdpau 
--enable-version3 --enable-x11grab||
||  libavutil      52. 18.100 / 52. 18.100||
||  libavcodec     54. 92.100 / 54. 92.100||
||  libavformat    54. 63.104 / 54. 63.104||
||  libavdevice    54.  3.103 / 54.  3.103||
||  libavfilter     3. 42.103 /  3. 42.103||
||  libswscale      2.  2.100 /  2.  2.100||
||  libswresample   0. 17.102 /  0. 17.102||
||  libpostproc    52.  2.100 / 52.  2.100||
||Hyper fast Audio and Video encoder||
||usage: ffmpeg [options] [[infile options] -i infile]... {[outfile 
options] outfile}...||
||
||Use -h to get full help or, even better, run 'man ffmpeg'|
&lt;/pre&gt;</description>
    <dc:creator>Micah Waddoups</dc:creator>
    <dc:date>2013-05-22T04:28:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164160">
    <title>Re: [PATCH] lavfi: add lut3d filter.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164160</link>
    <description>&lt;pre&gt;[...]

I've added the software that seem related to those formats. Unfortunately,
I don't own any, I just had a few random samples, so I can't really check
anything. Also, some extensions are shared with multiple softwares, and of
course different layouts. That's hard to tell which one belongs to which
one. There is certainly a room for improvements here.


Yes. But with the Hald CLUT we can do much better actually. See below.

Also, those sample are pretty huge (see
http://www.pandora-int.com/pandora/download/manual/cube_example.html)

[...]

Added.


It is described here: http://www.quelsolaar.com/technology/clut.html

I removed that chunk since I've implemented it in another filter already
(I'm still considering merging it with lut3d though).

The interesting thing about these Hald CLUT is that they are stored as
images, which allow much more awesome things. Typically, you generate an
identity LUT into a picture, process that picture with whatever color
filters, and then you can just use this picture to process your input. It
is interesting if your color filters are slow, or simply not implemented
in FFmpeg.

The other idea is to change this reference picture into a video stream to
allow updating it through the time. But we'll discuss all of this in the
patch I'll send soon.

[...]

Changed.


It's handy in this situation. I've renamed it in the caller to
"scaled_rgb" so you can make sense out of it.

[...]

Added some info above the 3 interpolation functions.

[...]

Cool, then... pushed. Thanks

&lt;/pre&gt;</description>
    <dc:creator>Clément Bœsch</dc:creator>
    <dc:date>2013-05-22T16:28:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164159">
    <title>Re: [Patch] AAC encoder improvements</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164159</link>
    <description>&lt;pre&gt;So, I've been keeping working on AAC, and I came to the conclusion
that a new encoder based on a dynamic programming approach, optimizing
rate distortion within bitrate constraints, would be the best choice.

Since this seems rather obvious, mostly because the x_trellis_x
functions seem to already use dynamic programming, I'm wondering if
anyone has already considered and discarded this. Especially since
such an algorithm would be a bit slower than twoloop (not sure by how
much yet).

The cost of a dynamic programming approach should be around Φ(W x Nsfb
x Nsfi), with W x Nsfb ~ 80 and Nsfi ~ 190 under normal circumstances,
and with currently twoloop being around Φ(W x Nsfb x 20). I included
the constants for a finer comparison, obviously.

Independently, with the insight gained while looking into this
RD-optimization approach, I got a few improvements to twoloop that are
worth pursuing. So I'll break it into tiny, manageable and tidy
patches soon. PSNR (tinypsnr) is still lying through its teeth... I'll
see about building a --psy option into it.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel&amp;lt; at &amp;gt;ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
&lt;/pre&gt;</description>
    <dc:creator>Claudio Freire</dc:creator>
    <dc:date>2013-05-22T15:36:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164158">
    <title>Re: [PATCH 2/2] Support playing SMV files.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164158</link>
    <description>&lt;pre&gt;
patch applied

maybe you want to add a fate/regression test for it

Thanks

[...]
&lt;/pre&gt;</description>
    <dc:creator>Michael Niedermayer</dc:creator>
    <dc:date>2013-05-22T13:37:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164157">
    <title>[PATCH] avcodec/libfaac: fallback to a supportedbitrate if the requested is not supported</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164157</link>
    <description>&lt;pre&gt;Fixes: Ticket2587

Signed-off-by: Michael Niedermayer &amp;lt;michaelni&amp;lt; at &amp;gt;gmx.at&amp;gt;
---
 libavcodec/libfaac.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c
index ac18fe2..f37e03a 100644
--- a/libavcodec/libfaac.c
+++ b/libavcodec/libfaac.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -151,9 +151,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static av_cold int Faac_encode_init(AVCodecContext *avctx)
     }
 
     if (!faacEncSetConfiguration(s-&amp;gt;faac_handle, faac_cfg)) {
-        av_log(avctx, AV_LOG_ERROR, "libfaac doesn't support this output format!\n");
-        ret = AVERROR(EINVAL);
-        goto error;
+        int i;
+        for (i = avctx-&amp;gt;bit_rate/1000; i ; i--) {
+            faac_cfg-&amp;gt;bitRate = 1000*i / avctx-&amp;gt;channels;
+            if (faacEncSetConfiguration(s-&amp;gt;faac_handle, faac_cfg))
+                break;
+        }
+        if (!i) {
+            av_log(avctx, AV_LOG_ERROR, "libfaac doesn't support this output format!\n");
+            ret = AVERROR(EINVAL);
+            goto error;
+        } else {
+            avctx-&amp;gt;bit_rate = 1000*i;
+            av_log(avctx, AV_LOG_WARNING, "libfaac doesn't support the specified bitrate, using %dkbit/s instead\n", i);
+        }
     }
 
     avctx-&amp;gt;delay = FAAC_DELAY_SAMPLES;
&lt;/pre&gt;</description>
    <dc:creator>Michael Niedermayer</dc:creator>
    <dc:date>2013-05-22T13:12:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164156">
    <title>Re: MOV: Fix old-style muxed raw-audio data</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164156</link>
    <description>&lt;pre&gt;

Please provide the sample.

Carl Eugen
&lt;/pre&gt;</description>
    <dc:creator>Carl Eugen Hoyos</dc:creator>
    <dc:date>2013-05-22T09:36:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164155">
    <title>Re: [PATCH] v4l2: make possible to disable libv4l2 at runtime.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164155</link>
    <description>&lt;pre&gt;Le primidi 1er prairial, an CCXXI, Clement Boesch a écrit :

Looks reasonable.

Regards,

&lt;/pre&gt;</description>
    <dc:creator>Nicolas George</dc:creator>
    <dc:date>2013-05-22T08:38:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164154">
    <title>Re: [PATCH] lavfi: add lut3d filter.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164154</link>
    <description>&lt;pre&gt;On date Tuesday 2013-05-21 04:49:06 +0200, Clément Bœsch encoded:


Adding some notes about these types may help (software used to create
them, reference, etc., so the user is not at the mercy of a search
engine).

Also I think having a tool for generating files in these formats
(e.g. using an ff expression) would be useful. Attaching a sample file
would also help to test it.



missing &amp;lt; at &amp;gt;file notice.

"Hald CLUT" sounds like funny nonsense to me.



I'm not fond of this kind of macros which assume the existence of a
variable, please make s a formal parameter and/or move the macro
within the function definition where it is used.



"s" is a poor name




ditto


For non trivial math a reference to an article/book/resource where you
find the formulas is always good for the reader.



I can't spot apparent mistakes, very nice job.
&lt;/pre&gt;</description>
    <dc:creator>Stefano Sabatini</dc:creator>
    <dc:date>2013-05-22T08:06:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164153">
    <title>Re: [PATCH 2/2] Support playing SMV files.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164153</link>
    <description>&lt;pre&gt;updated to use FF_CEIL_RSHIFT. The abs() was a throwback to testing, removing it changes the following '&amp;lt;' back to a '&amp;gt;'

Ash

---
From cfbd2b64f895cced7c6add679ad3c1dfc3bb3bc7 Mon Sep 17 00:00:00 2001
From: Ash Hughes &amp;lt;ashes-iontach&amp;lt; at &amp;gt;hotmail.com&amp;gt;
Date: Wed, 22 May 2013 02:05:34 +0100
Subject: [PATCH] Support playing SMV files

---
 MAINTAINERS             |   2 +
 libavcodec/Makefile     |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h    |   1 +
 libavcodec/codec_desc.c |   7 ++
 libavcodec/smvjpegdec.c | 187 ++++++++++++++++++++++++++++++++++++++++++++++++
 libavformat/wavdec.c    |  34 +++++++--
 7 files changed, 228 insertions(+), 5 deletions(-)
 create mode 100644 libavcodec/smvjpegdec.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 9f4301d..d316868 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -217,6 +217,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; Codecs:
   s3tc*                                 Ivo van Poorten
   smacker.c                             Kostya Shishkov
   smc.c                                 Mike Melanson
+  smvjpegdec.c                          Ash Hughes
   snow.c                                Michael Niedermayer, Loren Merritt
   sonic.c                               Alex Beregszaszi
   srt*                                  Aurelien Jacobs
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -463,6 +464,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; GnuPG Fingerprints of maintainers and contributors
 
 Anssi Hannula                 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB
 Anton Khirnov                 6D0C 6625 56F8 65D1 E5F5 814B B50A 1241 C067 07AB
+Ash Hughes                    694D 43D2 D180 C7C7 6421 ABD3 A641 D0B7 623D 6029
 Attila Kinali                 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765
 Baptiste Coudurier            8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA
 Ben Littler                   3EE3 3723 E560 3214 A8CD 4DEB 2CDB FCE7 768C 8D2C
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 0982885..1a58c69 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -387,6 +387,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; OBJS-$(CONFIG_SIPR_DECODER)            += sipr.o acelp_pitch_delay.o \
 OBJS-$(CONFIG_SMACKAUD_DECODER)        += smacker.o
 OBJS-$(CONFIG_SMACKER_DECODER)         += smacker.o
 OBJS-$(CONFIG_SMC_DECODER)             += smc.o
+OBJS-$(CONFIG_SMVJPEG_DECODER)         += smvjpegdec.o
 OBJS-$(CONFIG_SNOW_DECODER)            += snowdec.o snow.o snow_dwt.o
 OBJS-$(CONFIG_SNOW_ENCODER)            += snowenc.o snow.o snow_dwt.o             \
                                           h263.o ituh263enc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 1ebd46d..a15162d 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -245,6 +245,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void avcodec_register_all(void)
     REGISTER_DECODER(SGIRLE,            sgirle);
     REGISTER_DECODER(SMACKER,           smacker);
     REGISTER_DECODER(SMC,               smc);
+    REGISTER_DECODER(SMVJPEG,           smvjpeg);
     REGISTER_ENCDEC (SNOW,              snow);
     REGISTER_DECODER(SP5X,              sp5x);
     REGISTER_ENCDEC (SUNRAST,           sunrast);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index e959811..7ce9df4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -297,6 +297,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; enum AVCodecID {
     AV_CODEC_ID_MVC2       = MKBETAG('M','V','C','2'),
     AV_CODEC_ID_SNOW       = MKBETAG('S','N','O','W'),
     AV_CODEC_ID_WEBP       = MKBETAG('W','E','B','P'),
+    AV_CODEC_ID_SMVJPEG    = MKBETAG('S','M','V','J'),
 
     /* various PCM "codecs" */
     AV_CODEC_ID_FIRST_AUDIO = 0x10000,     ///&amp;lt; A dummy id pointing at the start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 72071b9..9309a8d 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1378,6 +1378,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"),
         .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
     },
+    {
+        .id        = AV_CODEC_ID_SMVJPEG,
+        .type      = AVMEDIA_TYPE_VIDEO,
+        .name      = "smv",
+        .long_name = NULL_IF_CONFIG_SMALL("Sigmatel Motion Video"),
+    },
+
 
     /* various PCM "codecs" */
     {
diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
new file mode 100644
index 0000000..4d20316
--- /dev/null
+++ b/libavcodec/smvjpegdec.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,187 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * SMV JPEG decoder
+ * Copyright (c) 2013 Ash Hughes
+ *
+ * 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
+ */
+
+/**
+ * &amp;lt; at &amp;gt;file
+ * SMV JPEG decoder.
+ */
+
+// #define DEBUG
+#include "avcodec.h"
+#include "libavutil/opt.h"
+#include "libavutil/imgutils.h"
+#include "mjpegdec.h"
+#include "internal.h"
+
+typedef struct SMVJpegDecodeContext {
+    MJpegDecodeContext jpg;
+    AVFrame *picture[2]; /* pictures array */
+    AVCodecContext* avctx;
+    int frames_per_jpeg;
+} SMVJpegDecodeContext;
+
+static inline void smv_img_pnt_plane(uint8_t      **dst, uint8_t *src,
+                                     int src_linesize, int height, int nlines)
+{
+    if (!dst || !src)
+        return;
+    src += (nlines) * src_linesize * height;
+    *dst = src;
+}
+
+static inline void smv_img_pnt(uint8_t *dst_data[4], uint8_t *src_data[4],
+                               const int src_linesizes[4],
+                               enum PixelFormat pix_fmt, int width, int height,
+                               int nlines)
+{
+    const AVPixFmtDescriptor *desc = &amp;amp;av_pix_fmt_descriptors[pix_fmt];
+    int i, planes_nb = 0;
+
+    if (desc-&amp;gt;flags &amp;amp; PIX_FMT_HWACCEL)
+        return;
+
+    for (i = 0; i &amp;lt; desc-&amp;gt;nb_components; i++)
+        planes_nb = FFMAX(planes_nb, desc-&amp;gt;comp[i].plane + 1);
+
+    for (i = 0; i &amp;lt; planes_nb; i++) {
+        int h = height;
+        if (i == 1 || i == 2) {
+            h = FF_CEIL_RSHIFT(height, desc-&amp;gt;log2_chroma_h);
+        }
+        smv_img_pnt_plane(&amp;amp;dst_data[i], src_data[i],
+            src_linesizes[i], h, nlines);
+    }
+}
+
+static av_cold int smvjpeg_decode_init(AVCodecContext *avctx)
+{
+    SMVJpegDecodeContext *s = avctx-&amp;gt;priv_data;
+    AVCodec *codec;
+    AVDictionary *thread_opt = NULL;
+    int ret = 0;
+
+    s-&amp;gt;frames_per_jpeg = 0;
+
+    s-&amp;gt;picture[0] = av_frame_alloc();
+    if (!s-&amp;gt;picture[0])
+        return AVERROR(ENOMEM);
+
+    s-&amp;gt;picture[1] = av_frame_alloc();
+    if (!s-&amp;gt;picture[1])
+        return AVERROR(ENOMEM);
+
+    s-&amp;gt;jpg.picture_ptr      = s-&amp;gt;picture[0];
+
+    if (avctx-&amp;gt;extradata_size &amp;gt;= 4)
+        s-&amp;gt;frames_per_jpeg = AV_RL32(avctx-&amp;gt;extradata);
+
+    if (s-&amp;gt;frames_per_jpeg &amp;lt;= 0) {
+        av_log(avctx, AV_LOG_ERROR, "Invalid number of frames per jpeg.\n");
+        ret = -1;
+    }
+
+    avcodec_get_frame_defaults(s-&amp;gt;picture[1]);
+    avctx-&amp;gt;coded_frame = s-&amp;gt;picture[1];
+    codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG);
+    if (!codec) {
+        av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n");
+        ret = -1;
+    }
+
+    s-&amp;gt;avctx = avcodec_alloc_context3(codec);
+
+    av_dict_set(&amp;amp;thread_opt, "threads", "1", 0);
+    if (ff_codec_open2_recursive(s-&amp;gt;avctx, codec, &amp;amp;thread_opt) &amp;lt; 0) {
+        av_log(avctx, AV_LOG_ERROR, "MJPEG codec failed to open\n");
+        ret = -1;
+    }
+    av_dict_free(&amp;amp;thread_opt);
+
+    return ret;
+}
+
+static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+                            AVPacket *avpkt)
+{
+    SMVJpegDecodeContext *s = avctx-&amp;gt;priv_data;
+    AVFrame* mjpeg_data = s-&amp;gt;picture[0];
+    int i, cur_frame = 0, ret = 0;
+
+    cur_frame = avpkt-&amp;gt;pts % s-&amp;gt;frames_per_jpeg;
+
+    /* Are we at the start of a block? */
+    if (!cur_frame)
+        ret = avcodec_decode_video2(s-&amp;gt;avctx, mjpeg_data, data_size, avpkt);
+    else /*use the last lot... */
+        *data_size = sizeof(AVPicture);
+
+    avctx-&amp;gt;pix_fmt = s-&amp;gt;avctx-&amp;gt;pix_fmt;
+
+    /* We shouldn't get here if frames_per_jpeg &amp;lt;= 0 because this was rejected
+       in init */
+    avcodec_set_dimensions(avctx, mjpeg_data-&amp;gt;width,
+        mjpeg_data-&amp;gt;height / s-&amp;gt;frames_per_jpeg);
+
+    s-&amp;gt;picture[1]-&amp;gt;extended_data = NULL;
+    s-&amp;gt;picture[1]-&amp;gt;width         = avctx-&amp;gt;width;
+    s-&amp;gt;picture[1]-&amp;gt;height        = avctx-&amp;gt;height;
+    s-&amp;gt;picture[1]-&amp;gt;format        = avctx-&amp;gt;pix_fmt;
+    /* ff_init_buffer_info(avctx, &amp;amp;s-&amp;gt;picture[1]); */
+    smv_img_pnt(s-&amp;gt;picture[1]-&amp;gt;data, mjpeg_data-&amp;gt;data, mjpeg_data-&amp;gt;linesize,
+                avctx-&amp;gt;pix_fmt, avctx-&amp;gt;width, avctx-&amp;gt;height, cur_frame);
+    for (i = 0; i &amp;lt; AV_NUM_DATA_POINTERS; i++)
+        s-&amp;gt;picture[1]-&amp;gt;linesize[i] = mjpeg_data-&amp;gt;linesize[i];
+
+    ret = av_frame_ref(data, s-&amp;gt;picture[1]);
+
+    return ret;
+}
+
+static av_cold int smvjpeg_decode_end(AVCodecContext *avctx)
+{
+    SMVJpegDecodeContext *s = avctx-&amp;gt;priv_data;
+    MJpegDecodeContext *jpg = &amp;amp;s-&amp;gt;jpg;
+
+    jpg-&amp;gt;picture_ptr = NULL;
+    av_frame_free(&amp;amp;s-&amp;gt;picture[1]);
+    ff_codec_close_recursive(s-&amp;gt;avctx);
+    av_freep(&amp;amp;s-&amp;gt;avctx);
+    return 0;
+}
+
+static const AVClass smvjpegdec_class = {
+    .class_name = "SMVJPEG decoder",
+    .item_name  = av_default_item_name,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_smvjpeg_decoder = {
+    .name           = "smvjpeg",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = AV_CODEC_ID_SMVJPEG,
+    .priv_data_size = sizeof(SMVJpegDecodeContext),
+    .init           = smvjpeg_decode_init,
+    .close          = smvjpeg_decode_end,
+    .decode         = smvjpeg_decode_frame,
+    .max_lowres     = 3,
+    .long_name      = NULL_IF_CONFIG_SMALL("SMV JPEG"),
+    .priv_class     = &amp;amp;smvjpegdec_class,
+};
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 874847e..a94c0a9 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -25,6 +25,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 #include "libavutil/avassert.h"
 #include "libavutil/dict.h"
+#include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -51,6 +52,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; typedef struct WAVDemuxContext {
     int audio_eof;
     int ignore_length;
     int spdif;
+    int smv_cur_pt;
+    int smv_given_first;
 } WAVDemuxContext;
 
 #if CONFIG_WAV_DEMUXER
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -337,15 +340,23 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wav_read_header(AVFormatContext *s)
                 goto break_loop;
             }
             av_log(s, AV_LOG_DEBUG, "Found SMV data\n");
+            wav-&amp;gt;smv_given_first = 0;
             vst = avformat_new_stream(s, NULL);
             if (!vst)
                 return AVERROR(ENOMEM);
             avio_r8(pb);
             vst-&amp;gt;id = 1;
             vst-&amp;gt;codec-&amp;gt;codec_type = AVMEDIA_TYPE_VIDEO;
-            vst-&amp;gt;codec-&amp;gt;codec_id = AV_CODEC_ID_MJPEG;
+            vst-&amp;gt;codec-&amp;gt;codec_id = AV_CODEC_ID_SMVJPEG;
             vst-&amp;gt;codec-&amp;gt;width  = avio_rl24(pb);
             vst-&amp;gt;codec-&amp;gt;height = avio_rl24(pb);
+            vst-&amp;gt;codec-&amp;gt;extradata_size = 4;
+            vst-&amp;gt;codec-&amp;gt;extradata = av_malloc(vst-&amp;gt;codec-&amp;gt;extradata_size +
+                                              FF_INPUT_BUFFER_PADDING_SIZE);
+            if (!vst-&amp;gt;codec-&amp;gt;extradata) {
+                av_log(s, AV_LOG_ERROR, "Could not allocate extradata.\n");
+                return AVERROR(ENOMEM);
+            }
             size = avio_rl24(pb);
             wav-&amp;gt;smv_data_ofs = avio_tell(pb) + (size - 5) * 3;
             avio_rl24(pb);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -355,6 +366,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wav_read_header(AVFormatContext *s)
             avio_rl24(pb);
             avio_rl24(pb);
             wav-&amp;gt;smv_frames_per_jpeg = avio_rl24(pb);
+            AV_WL32(vst-&amp;gt;codec-&amp;gt;extradata, wav-&amp;gt;smv_frames_per_jpeg);
+            wav-&amp;gt;smv_cur_pt = 0;
             goto break_loop;
         case MKTAG('L', 'I', 'S', 'T'):
             if (size &amp;lt; 4) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -447,10 +460,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wav_read_packet(AVFormatContext *s, AVPacket *pkt)
 smv_retry:
         audio_dts = s-&amp;gt;streams[0]-&amp;gt;cur_dts;
         video_dts = s-&amp;gt;streams[1]-&amp;gt;cur_dts;
+
         if (audio_dts != AV_NOPTS_VALUE &amp;amp;&amp;amp; video_dts != AV_NOPTS_VALUE) {
             audio_dts = av_rescale_q(audio_dts, s-&amp;gt;streams[0]-&amp;gt;time_base, AV_TIME_BASE_Q);
             video_dts = av_rescale_q(video_dts, s-&amp;gt;streams[1]-&amp;gt;time_base, AV_TIME_BASE_Q);
-            wav-&amp;gt;smv_last_stream = video_dts &amp;gt;= audio_dts;
+            /*We always return a video frame first to get the pixel format first*/
+            wav-&amp;gt;smv_last_stream = wav-&amp;gt;smv_given_first ? video_dts &amp;gt; audio_dts : 0;
+            wav-&amp;gt;smv_given_first = 1;
         }
         wav-&amp;gt;smv_last_stream = !wav-&amp;gt;smv_last_stream;
         wav-&amp;gt;smv_last_stream |= wav-&amp;gt;audio_eof;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -468,8 +484,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; smv_retry:
             if (ret &amp;lt; 0)
                 goto smv_out;
             pkt-&amp;gt;pos -= 3;
-            pkt-&amp;gt;pts = wav-&amp;gt;smv_block * wav-&amp;gt;smv_frames_per_jpeg;
-            wav-&amp;gt;smv_block++;
+            pkt-&amp;gt;pts = wav-&amp;gt;smv_block * wav-&amp;gt;smv_frames_per_jpeg + wav-&amp;gt;smv_cur_pt;
+            wav-&amp;gt;smv_cur_pt++;
+            if (wav-&amp;gt;smv_frames_per_jpeg &amp;gt; 0)
+                wav-&amp;gt;smv_cur_pt %= wav-&amp;gt;smv_frames_per_jpeg;
+            if (!wav-&amp;gt;smv_cur_pt)
+                wav-&amp;gt;smv_block++;
+
             pkt-&amp;gt;stream_index = 1;
 smv_out:
             avio_seek(s-&amp;gt;pb, old_pos, SEEK_SET);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -528,7 +549,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wav_read_seek(AVFormatContext *s,
             smv_timestamp = av_rescale_q(timestamp, s-&amp;gt;streams[0]-&amp;gt;time_base, s-&amp;gt;streams[1]-&amp;gt;time_base);
         else
             timestamp = av_rescale_q(smv_timestamp, s-&amp;gt;streams[1]-&amp;gt;time_base, s-&amp;gt;streams[0]-&amp;gt;time_base);
-        wav-&amp;gt;smv_block = smv_timestamp / wav-&amp;gt;smv_frames_per_jpeg;
+        if (wav-&amp;gt;smv_frames_per_jpeg &amp;gt; 0) {
+            wav-&amp;gt;smv_block = smv_timestamp / wav-&amp;gt;smv_frames_per_jpeg;
+            wav-&amp;gt;smv_cur_pt = smv_timestamp % wav-&amp;gt;smv_frames_per_jpeg;
+        }
     }
 
     st = s-&amp;gt;streams[0];
&lt;/pre&gt;</description>
    <dc:creator>Ash Hughes</dc:creator>
    <dc:date>2013-05-22T01:16:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164152">
    <title>MOV: Fix old-style muxed raw-audio data</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164152</link>
    <description>&lt;pre&gt;Hi ffmpeg-devel,

I found that commit
http://ffmpeg.org/pipermail/ffmpeg-cvslog/2012-March/048842.html
breaks MOV demuxing in case if input file has PCM audio inside and wrong
STSZ sample_size for this audio trak.

I have a file which I successfully transcoded with ffmpeg before this patch:

Audio trak is PCM signed 16 LE.
Timescale = 48000
num_channels = 2
bits_per_sample = 16

Each sample duration = 1, so Each sample size should be = num_channels *
bits_per_sample / 8 * duration = 4 bytes
But STSZ wrongly has sample_size = 1 byte.

Before this patch
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50059bde77674977d9134f3c1151a63cb7a2391c
ffmpeg was able to fix this stream error and decode audio successfully.

Please advice here.
&lt;/pre&gt;</description>
    <dc:creator>Alex Sukhanov</dc:creator>
    <dc:date>2013-05-21T19:42:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164151">
    <title>Re: [PATCH] vf_subtitles: add line_spacing option</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164151</link>
    <description>&lt;pre&gt;[...]

I think Jean wanted to send a new version after Nicolas' comment.

&lt;/pre&gt;</description>
    <dc:creator>Clément Bœsch</dc:creator>
    <dc:date>2013-05-21T21:14:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164150">
    <title>Re: [PATCH] vf_subtitles: add line_spacing option</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164150</link>
    <description>&lt;pre&gt;
if the patch is fine, shouldnt it be applied ? or do you want me
to apply it ?

[...]

&lt;/pre&gt;</description>
    <dc:creator>Michael Niedermayer</dc:creator>
    <dc:date>2013-05-21T20:52:38</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164149">
    <title>Re: [PATCH 2/2] Support playing SMV files.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164149</link>
    <description>&lt;pre&gt;
seems i forgot about this patch
thanks for the ping

[...]



FF_CEIL_RSHIFT()


[...]

what does the abs do here ?

also you might want to add yourself to MAINTAINERS and setup a
public git clone of ffmpeg where you maintain the code if you agree to
maintain it once its in ffmpeg ...

[...]

&lt;/pre&gt;</description>
    <dc:creator>Michael Niedermayer</dc:creator>
    <dc:date>2013-05-21T20:50:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164148">
    <title>Re: [PATCH] vf_subtitles: add line_spacing option</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164148</link>
    <description>&lt;pre&gt;
I don't know, but it seems there are quite some configuration settings
that could be set:

    % grep 'void ass_set_' /usr/include/ass/ass.h
    void ass_set_fonts_dir(ASS_Library *priv, const char *fonts_dir);
    void ass_set_extract_fonts(ASS_Library *priv, int extract);
    void ass_set_style_overrides(ASS_Library *priv, char **list);
    void ass_set_message_cb(ASS_Library *priv, void (*msg_cb)
    void ass_set_frame_size(ASS_Renderer *priv, int w, int h);
    void ass_set_shaper(ASS_Renderer *priv, ASS_ShapingLevel level);
    void ass_set_margins(ASS_Renderer *priv, int t, int b, int l, int r);
    void ass_set_use_margins(ASS_Renderer *priv, int use);
    void ass_set_aspect_ratio(ASS_Renderer *priv, double dar, double sar);
    void ass_set_font_scale(ASS_Renderer *priv, double font_scale);
    void ass_set_hinting(ASS_Renderer *priv, ASS_Hinting ht);
    void ass_set_line_spacing(ASS_Renderer *priv, double line_spacing);
    void ass_set_line_position(ASS_Renderer *priv, double line_position);
    void ass_set_fonts(ASS_Renderer *priv, const char *default_font,
    void ass_set_cache_limits(ASS_Renderer *priv, int glyph_max,

How relevant they are, I don't know. The patch in itself is fine, It's
just too bad not to port a bunch of others settings.

&lt;/pre&gt;</description>
    <dc:creator>Clément Bœsch</dc:creator>
    <dc:date>2013-05-21T20:23:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164147">
    <title>Re: [PATCH] lavfi/geq: prefer symbolic constants</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164147</link>
    <description>&lt;pre&gt;On date Monday 2013-05-20 00:27:36 +0200, Clément Bœsch encoded:


Don't know what it means.

[...] 

Applied.
&lt;/pre&gt;</description>
    <dc:creator>Stefano Sabatini</dc:creator>
    <dc:date>2013-05-21T20:06:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164146">
    <title>Re: [PATCH] lavfi/geq: add aliases for RGB options</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164146</link>
    <description>&lt;pre&gt;On date Monday 2013-05-20 13:55:56 +0200, Michael Niedermayer encoded:

Applied.
&lt;/pre&gt;</description>
    <dc:creator>Stefano Sabatini</dc:creator>
    <dc:date>2013-05-21T20:04:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164145">
    <title>Re: [PATCH 2/2] Support playing SMV files.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164145</link>
    <description>&lt;pre&gt;Does this still need more work? ffmpeg now plays and converts all of the samples correctly with this patch, so far as I can see.

A

From: ashes-iontach&amp;lt; at &amp;gt;hotmail.com
To: ffmpeg-devel&amp;lt; at &amp;gt;ffmpeg.org
Subject: RE: [FFmpeg-devel] [PATCH 2/2] Support playing SMV files.
Date: Wed, 17 Apr 2013 00:33:19 +0000




Updated, similar to other decoders,

Ash

---

From faf3706922771f02c8e1d23d7bcafdcad3488a97 Mon Sep 17 00:00:00 2001
From: Ash Hughes &amp;lt;ashes-iontach&amp;lt; at &amp;gt;hotmail.com&amp;gt;
Date: Wed, 17 Apr 2013 01:27:18 +0100
Subject: [PATCH 1/1] Support playing SMV files

---
 libavcodec/Makefile     |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h    |   1 +
 libavcodec/codec_desc.c |   7 ++
 libavcodec/smvjpegdec.c | 187 ++++++++++++++++++++++++++++++++++++++++++++++++
 libavformat/wavdec.c    |  38 ++++++++--
 6 files changed, 228 insertions(+), 7 deletions(-)
 create mode 100644 libavcodec/smvjpegdec.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 357ac48..327f753 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -382,6 +382,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; OBJS-$(CONFIG_SIPR_DECODER)            += sipr.o acelp_pitch_delay.o \
 OBJS-$(CONFIG_SMACKAUD_DECODER)        += smacker.o
 OBJS-$(CONFIG_SMACKER_DECODER)         += smacker.o
 OBJS-$(CONFIG_SMC_DECODER)             += smc.o
+OBJS-$(CONFIG_SMVJPEG_DECODER)         += smvjpegdec.o
 OBJS-$(CONFIG_SNOW_DECODER)            += snowdec.o snow.o snow_dwt.o
 OBJS-$(CONFIG_SNOW_ENCODER)            += snowenc.o snow.o snow_dwt.o             \
                                           h263.o ituh263enc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b06e9a5..34aeb79 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -243,6 +243,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void avcodec_register_all(void)
     REGISTER_DECODER(SGIRLE,            sgirle);
     REGISTER_DECODER(SMACKER,           smacker);
     REGISTER_DECODER(SMC,               smc);
+    REGISTER_DECODER(SMVJPEG,           smvjpeg);
     REGISTER_ENCDEC (SNOW,              snow);
     REGISTER_DECODER(SP5X,              sp5x);
     REGISTER_ENCDEC (SUNRAST,           sunrast);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 3f52037..57cd8a1 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -293,6 +293,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; enum AVCodecID {
     AV_CODEC_ID_MVC2       = MKBETAG('M','V','C','2'),
     AV_CODEC_ID_SNOW       = MKBETAG('S','N','O','W'),
     AV_CODEC_ID_WEBP       = MKBETAG('W','E','B','P'),
+    AV_CODEC_ID_SMVJPEG    = MKBETAG('S','M','V','J'),
 
     /* various PCM "codecs" */
     AV_CODEC_ID_FIRST_AUDIO = 0x10000,     ///&amp;lt; A dummy id pointing at the start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 2b3eed7..4f629e2 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1371,6 +1371,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"),
         .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
     },
+    {
+        .id        = AV_CODEC_ID_SMVJPEG,
+        .type      = AVMEDIA_TYPE_VIDEO,
+        .name      = "smv",
+        .long_name = NULL_IF_CONFIG_SMALL("Sigmatel Motion Video"),
+    },
+
 
     /* various PCM "codecs" */
     {
diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
new file mode 100644
index 0000000..431fd04
--- /dev/null
+++ b/libavcodec/smvjpegdec.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,187 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * SMV JPEG decoder
+ * Copyright (c) 2013 Ash Hughes
+ *
+ * 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
+ */
+
+/**
+ * &amp;lt; at &amp;gt;file
+ * SMV JPEG decoder.
+ */
+
+// #define DEBUG
+#include "avcodec.h"
+#include "libavutil/opt.h"
+#include "libavutil/imgutils.h"
+#include "mjpegdec.h"
+#include "internal.h"
+
+typedef struct SMVJpegDecodeContext {
+    MJpegDecodeContext jpg;
+    AVFrame *picture[2]; /* pictures array */
+    AVCodecContext* avctx;
+    int frames_per_jpeg;
+} SMVJpegDecodeContext;
+
+static inline void smv_img_pnt_plane(uint8_t      **dst, uint8_t *src,
+                                     int src_linesize, int height, int nlines)
+{
+    if (!dst || !src)
+        return;
+    src += (nlines) * src_linesize * height;
+    *dst = src;
+}
+
+static inline void smv_img_pnt(uint8_t *dst_data[4], uint8_t *src_data[4],
+                               const int src_linesizes[4],
+                               enum PixelFormat pix_fmt, int width, int height,
+                               int nlines)
+{
+    const AVPixFmtDescriptor *desc = &amp;amp;av_pix_fmt_descriptors[pix_fmt];
+    int i, planes_nb = 0;
+
+    if (desc-&amp;gt;flags &amp;amp; PIX_FMT_HWACCEL)
+        return;
+
+    for (i = 0; i &amp;lt; desc-&amp;gt;nb_components; i++)
+        planes_nb = FFMAX(planes_nb, desc-&amp;gt;comp[i].plane + 1);
+
+    for (i = 0; i &amp;lt; planes_nb; i++) {
+        int h = height;
+        if (i == 1 || i == 2) {
+            h= -((-height)&amp;gt;&amp;gt;desc-&amp;gt;log2_chroma_h);
+        }
+        smv_img_pnt_plane(&amp;amp;dst_data[i], src_data[i],
+            src_linesizes[i], h, nlines);
+    }
+}
+
+static av_cold int smvjpeg_decode_init(AVCodecContext *avctx)
+{
+    SMVJpegDecodeContext *s = avctx-&amp;gt;priv_data;
+    AVCodec *codec;
+    AVDictionary *thread_opt = NULL;
+    int ret = 0;
+
+    s-&amp;gt;frames_per_jpeg = 0;
+
+    s-&amp;gt;picture[0] = av_frame_alloc();
+    if (!s-&amp;gt;picture[0])
+        return AVERROR(ENOMEM);
+
+    s-&amp;gt;picture[1] = av_frame_alloc();
+    if (!s-&amp;gt;picture[1])
+        return AVERROR(ENOMEM);
+
+    s-&amp;gt;jpg.picture_ptr      = s-&amp;gt;picture[0];
+
+    if (avctx-&amp;gt;extradata_size &amp;gt;= 4)
+        s-&amp;gt;frames_per_jpeg = AV_RL32(avctx-&amp;gt;extradata);
+
+    if (s-&amp;gt;frames_per_jpeg &amp;lt;= 0) {
+        av_log(avctx, AV_LOG_ERROR, "Invalid number of frames per jpeg.\n");
+        ret = -1;
+    }
+
+    avcodec_get_frame_defaults(s-&amp;gt;picture[1]);
+    avctx-&amp;gt;coded_frame = s-&amp;gt;picture[1];
+    codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG);
+    if (!codec) {
+        av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n");
+        ret = -1;
+    }
+
+    s-&amp;gt;avctx = avcodec_alloc_context3(codec);
+
+    av_dict_set(&amp;amp;thread_opt, "threads", "1", 0);
+    if (ff_codec_open2_recursive(s-&amp;gt;avctx, codec, &amp;amp;thread_opt) &amp;lt; 0) {
+        av_log(avctx, AV_LOG_ERROR, "MJPEG codec failed to open\n");
+        ret = -1;
+    }
+    av_dict_free(&amp;amp;thread_opt);
+
+    return ret;
+}
+
+static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+                            AVPacket *avpkt)
+{
+    SMVJpegDecodeContext *s = avctx-&amp;gt;priv_data;
+    AVFrame* mjpeg_data = s-&amp;gt;picture[0];
+    int i, cur_frame = 0, ret = 0;
+
+    cur_frame = avpkt-&amp;gt;pts % s-&amp;gt;frames_per_jpeg;
+
+    /* Are we at the start of a block? */
+    if (!cur_frame)
+        ret = avcodec_decode_video2(s-&amp;gt;avctx, mjpeg_data, data_size, avpkt);
+    else /*use the last lot... */
+        *data_size = sizeof(AVPicture);
+
+    avctx-&amp;gt;pix_fmt = s-&amp;gt;avctx-&amp;gt;pix_fmt;
+
+    /* We shouldn't get here if frames_per_jpeg &amp;lt;= 0 because this was rejected
+       in init */
+    avcodec_set_dimensions(avctx, mjpeg_data-&amp;gt;width,
+        mjpeg_data-&amp;gt;height / s-&amp;gt;frames_per_jpeg);
+
+    s-&amp;gt;picture[1]-&amp;gt;extended_data = NULL;
+    s-&amp;gt;picture[1]-&amp;gt;width         = avctx-&amp;gt;width;
+    s-&amp;gt;picture[1]-&amp;gt;height        = avctx-&amp;gt;height;
+    s-&amp;gt;picture[1]-&amp;gt;format        = avctx-&amp;gt;pix_fmt;
+    /* ff_init_buffer_info(avctx, &amp;amp;s-&amp;gt;picture[1]); */
+    smv_img_pnt(s-&amp;gt;picture[1]-&amp;gt;data, mjpeg_data-&amp;gt;data, mjpeg_data-&amp;gt;linesize,
+                avctx-&amp;gt;pix_fmt, avctx-&amp;gt;width, avctx-&amp;gt;height, cur_frame);
+    for (i = 0; i &amp;lt; AV_NUM_DATA_POINTERS; i++)
+        s-&amp;gt;picture[1]-&amp;gt;linesize[i] = mjpeg_data-&amp;gt;linesize[i];
+
+    ret = av_frame_ref(data, s-&amp;gt;picture[1]);
+
+    return ret;
+}
+
+static av_cold int smvjpeg_decode_end(AVCodecContext *avctx)
+{
+    SMVJpegDecodeContext *s = avctx-&amp;gt;priv_data;
+    MJpegDecodeContext *jpg = &amp;amp;s-&amp;gt;jpg;
+
+    jpg-&amp;gt;picture_ptr = NULL;
+    av_frame_free(&amp;amp;s-&amp;gt;picture[1]);
+    ff_codec_close_recursive(s-&amp;gt;avctx);
+    av_freep(&amp;amp;s-&amp;gt;avctx);
+    return 0;
+}
+
+static const AVClass smvjpegdec_class = {
+    .class_name = "SMVJPEG decoder",
+    .item_name  = av_default_item_name,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_smvjpeg_decoder = {
+    .name           = "smvjpeg",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = AV_CODEC_ID_SMVJPEG,
+    .priv_data_size = sizeof(SMVJpegDecodeContext),
+    .init           = smvjpeg_decode_init,
+    .close          = smvjpeg_decode_end,
+    .decode         = smvjpeg_decode_frame,
+    .max_lowres     = 3,
+    .long_name      = NULL_IF_CONFIG_SMALL("SMV JPEG"),
+    .priv_class     = &amp;amp;smvjpegdec_class,
+};
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 14c52f8..963812c 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -25,6 +25,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 #include "libavutil/avassert.h"
 #include "libavutil/dict.h"
+#include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -51,6 +52,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; typedef struct WAVDemuxContext {
     int audio_eof;
     int ignore_length;
     int spdif;
+    int smv_cur_pt;
+    int smv_given_first;
 } WAVDemuxContext;
 
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -323,15 +326,23 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wav_read_header(AVFormatContext *s)
                 goto break_loop;
             }
             av_log(s, AV_LOG_DEBUG, "Found SMV data\n");
+            wav-&amp;gt;smv_given_first = 0;
             vst = avformat_new_stream(s, NULL);
             if (!vst)
                 return AVERROR(ENOMEM);
             avio_r8(pb);
             vst-&amp;gt;id = 1;
             vst-&amp;gt;codec-&amp;gt;codec_type = AVMEDIA_TYPE_VIDEO;
-            vst-&amp;gt;codec-&amp;gt;codec_id = AV_CODEC_ID_MJPEG;
+            vst-&amp;gt;codec-&amp;gt;codec_id = AV_CODEC_ID_SMVJPEG;
             vst-&amp;gt;codec-&amp;gt;width  = avio_rl24(pb);
             vst-&amp;gt;codec-&amp;gt;height = avio_rl24(pb);
+            vst-&amp;gt;codec-&amp;gt;extradata_size = 4;
+            vst-&amp;gt;codec-&amp;gt;extradata = av_malloc(vst-&amp;gt;codec-&amp;gt;extradata_size +
+                                              FF_INPUT_BUFFER_PADDING_SIZE);
+            if (!vst-&amp;gt;codec-&amp;gt;extradata) {
+                av_log(s, AV_LOG_ERROR, "Could not allocate extradata.\n");
+                return AVERROR(ENOMEM);
+            }
             size = avio_rl24(pb);
             wav-&amp;gt;smv_data_ofs = avio_tell(pb) + (size - 5) * 3;
             avio_rl24(pb);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -341,6 +352,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wav_read_header(AVFormatContext *s)
             avio_rl24(pb);
             avio_rl24(pb);
             wav-&amp;gt;smv_frames_per_jpeg = avio_rl24(pb);
+            AV_WL32(vst-&amp;gt;codec-&amp;gt;extradata, wav-&amp;gt;smv_frames_per_jpeg);
+            wav-&amp;gt;smv_cur_pt = 0;
             goto break_loop;
         case MKTAG('L', 'I', 'S', 'T'):
             if (size &amp;lt; 4) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -432,10 +445,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wav_read_packet(AVFormatContext *s,
 smv_retry:
         audio_dts = s-&amp;gt;streams[0]-&amp;gt;cur_dts;
         video_dts = s-&amp;gt;streams[1]-&amp;gt;cur_dts;
+
         if (audio_dts != AV_NOPTS_VALUE &amp;amp;&amp;amp; video_dts != AV_NOPTS_VALUE) {
-            audio_dts = av_rescale_q(audio_dts, s-&amp;gt;streams[0]-&amp;gt;time_base, AV_TIME_BASE_Q);
-            video_dts = av_rescale_q(video_dts, s-&amp;gt;streams[1]-&amp;gt;time_base, AV_TIME_BASE_Q);
-            wav-&amp;gt;smv_last_stream = video_dts &amp;gt;= audio_dts;
+            audio_dts = abs(av_rescale_q(audio_dts, s-&amp;gt;streams[0]-&amp;gt;time_base, AV_TIME_BASE_Q));
+            video_dts = abs(av_rescale_q(video_dts, s-&amp;gt;streams[1]-&amp;gt;time_base, AV_TIME_BASE_Q));
+            /*We always return a video frame first to get the pixel format first*/
+            wav-&amp;gt;smv_last_stream = wav-&amp;gt;smv_given_first ? video_dts &amp;lt; audio_dts : 0;
+            wav-&amp;gt;smv_given_first = 1;
         }
         wav-&amp;gt;smv_last_stream = !wav-&amp;gt;smv_last_stream;
         wav-&amp;gt;smv_last_stream |= wav-&amp;gt;audio_eof;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -453,8 +469,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; smv_retry:
             if (ret &amp;lt; 0)
                 goto smv_out;
             pkt-&amp;gt;pos -= 3;
-            pkt-&amp;gt;pts = wav-&amp;gt;smv_block * wav-&amp;gt;smv_frames_per_jpeg;
-            wav-&amp;gt;smv_block++;
+            pkt-&amp;gt;pts = wav-&amp;gt;smv_block * wav-&amp;gt;smv_frames_per_jpeg + wav-&amp;gt;smv_cur_pt;
+            wav-&amp;gt;smv_cur_pt++;
+            if (wav-&amp;gt;smv_frames_per_jpeg &amp;gt; 0)
+                wav-&amp;gt;smv_cur_pt %= wav-&amp;gt;smv_frames_per_jpeg;
+            if (!wav-&amp;gt;smv_cur_pt)
+                wav-&amp;gt;smv_block++;
+
             pkt-&amp;gt;stream_index = 1;
 smv_out:
             avio_seek(s-&amp;gt;pb, old_pos, SEEK_SET);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -513,7 +534,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int wav_read_seek(AVFormatContext *s,
             smv_timestamp = av_rescale_q(timestamp, s-&amp;gt;streams[0]-&amp;gt;time_base, s-&amp;gt;streams[1]-&amp;gt;time_base);
         else
             timestamp = av_rescale_q(smv_timestamp, s-&amp;gt;streams[1]-&amp;gt;time_base, s-&amp;gt;streams[0]-&amp;gt;time_base);
-        wav-&amp;gt;smv_block = smv_timestamp / wav-&amp;gt;smv_frames_per_jpeg;
+        if (wav-&amp;gt;smv_frames_per_jpeg &amp;gt; 0) {
+            wav-&amp;gt;smv_block = smv_timestamp / wav-&amp;gt;smv_frames_per_jpeg;
+            wav-&amp;gt;smv_cur_pt = smv_timestamp % wav-&amp;gt;smv_frames_per_jpeg;
+        }
     }
 
     st = s-&amp;gt;streams[0];
&lt;/pre&gt;</description>
    <dc:creator>Ash Hughes</dc:creator>
    <dc:date>2013-05-21T19:21:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164144">
    <title>Re: [PATCH] seek-test: make duration userconfigurable</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164144</link>
    <description>&lt;pre&gt;
applied

[...]
&lt;/pre&gt;</description>
    <dc:creator>Michael Niedermayer</dc:creator>
    <dc:date>2013-05-21T16:39:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164143">
    <title>Re: [PATCH 1/2] avcodec/vda_h264: use av_buffer tomanage buffers</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164143</link>
    <description>&lt;pre&gt;I'd like to withdraw this patchset. The maintainer of vda_h264, Sebastien
Zwickert, sent me his patch about this problem, and I think his solution is
better. He said that his patch was still in test, and would be sent to the
mailing list soon.

On Tue, May 21, 2013 at 12:12 PM, Xidorn Quan &amp;lt;quanxunzhen&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:



&lt;/pre&gt;</description>
    <dc:creator>Xidorn Quan</dc:creator>
    <dc:date>2013-05-21T16:16:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164142">
    <title>Re: [PATCH 1/2] add YUVJ411P</title>
    <link>http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/164142</link>
    <description>&lt;pre&gt;yes

yes

yes

yes

yes

&lt;/pre&gt;</description>
    <dc:creator>Paul B Mahol</dc:creator>
    <dc:date>2013-05-21T14:39:57</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.video.ffmpeg.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.video.ffmpeg.devel</link>
  </textinput>
</rdf:RDF>
