[FFmpeg-cvslog] r10617 - in trunk: Changelog doc/general.texi libavcodec/Makefile libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/mjpegdec.c libavcodec/sp5xdec.c

vitor subversion
Sat Sep 29 17:20:22 CEST 2007


Author: vitor
Date: Sat Sep 29 17:20:22 2007
New Revision: 10617

Log:
AMV video decoder.
Patch by Vladimir Voroshilov (voroshil - gmail - com)


Modified:
   trunk/Changelog
   trunk/doc/general.texi
   trunk/libavcodec/Makefile
   trunk/libavcodec/allcodecs.c
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/mjpegdec.c
   trunk/libavcodec/sp5xdec.c

Modified: trunk/Changelog
==============================================================================
--- trunk/Changelog	(original)
+++ trunk/Changelog	Sat Sep 29 17:20:22 2007
@@ -95,7 +95,7 @@ version <next>
 - Matroska muxer
 - Slice-based parallel H.264 decoding
 - Monkey's Audio demuxer and decoder
-- AMV audio decoder
+- AMV audio and video decoder
 
 version 0.4.9-pre1:
 

Modified: trunk/doc/general.texi
==============================================================================
--- trunk/doc/general.texi	(original)
+++ trunk/doc/general.texi	Sat Sep 29 17:20:22 2007
@@ -231,6 +231,7 @@ following image formats are supported:
 @item THP                    @tab     @tab  X @tab Used on the Nintendo GameCube.
 @item Bethsoft VID           @tab     @tab  X @tab Used in some games from Bethesda Softworks.
 @item Renderware TXD         @tab     @tab  X @tab Texture dictionaries used by the Renderware Engine.
+ at item AMV                    @tab     @tab  X @tab Used in chinese MP3 players
 @end multitable
 
 @code{X} means that encoding (resp. decoding) is supported.

Modified: trunk/libavcodec/Makefile
==============================================================================
--- trunk/libavcodec/Makefile	(original)
+++ trunk/libavcodec/Makefile	Sat Sep 29 17:20:22 2007
@@ -35,6 +35,7 @@ OBJS-$(CONFIG_AASC_DECODER)            +
 OBJS-$(CONFIG_AC3_DECODER)             += ac3dec.o ac3tab.o ac3.o mdct.o fft.o
 OBJS-$(CONFIG_AC3_ENCODER)             += ac3enc.o ac3tab.o ac3.o
 OBJS-$(CONFIG_ALAC_DECODER)            += alac.o
+OBJS-$(CONFIG_AMV_DECODER)             += sp5xdec.o mjpegdec.o mjpeg.o
 OBJS-$(CONFIG_APE_DECODER)             += apedec.o
 OBJS-$(CONFIG_ASV1_DECODER)            += asv1.o
 OBJS-$(CONFIG_ASV1_ENCODER)            += asv1.o

Modified: trunk/libavcodec/allcodecs.c
==============================================================================
--- trunk/libavcodec/allcodecs.c	(original)
+++ trunk/libavcodec/allcodecs.c	Sat Sep 29 17:20:22 2007
@@ -61,6 +61,7 @@ void avcodec_register_all(void)
 
     /* video codecs */
     REGISTER_DECODER (AASC, aasc);
+    REGISTER_DECODER (AMV, amv);
     REGISTER_ENCDEC  (ASV1, asv1);
     REGISTER_ENCDEC  (ASV2, asv2);
     REGISTER_DECODER (AVS, avs);

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	(original)
+++ trunk/libavcodec/avcodec.h	Sat Sep 29 17:20:22 2007
@@ -167,6 +167,7 @@ enum CodecID {
     CODEC_ID_PTX,
     CODEC_ID_TXD,
     CODEC_ID_VP6A,
+    CODEC_ID_AMV,
 
     /* various PCM "codecs" */
     CODEC_ID_PCM_S16LE= 0x10000,

Modified: trunk/libavcodec/mjpegdec.c
==============================================================================
--- trunk/libavcodec/mjpegdec.c	(original)
+++ trunk/libavcodec/mjpegdec.c	Sat Sep 29 17:20:22 2007
@@ -669,6 +669,11 @@ static int mjpeg_decode_scan(MJpegDecode
         int c = s->comp_index[i];
         data[c] = s->picture.data[c];
         linesize[c]=s->linesize[c];
+        if(s->avctx->codec->id==CODEC_ID_AMV) {
+            //picture should be flipped upside-down for this codec
+            data[c] += (linesize[c] * (s->v_scount[i] * 8 * s->mb_height - 1));
+            linesize[c] *= -1;
+        }
     }
 
     for(mb_y = 0; mb_y < s->mb_height; mb_y++) {

Modified: trunk/libavcodec/sp5xdec.c
==============================================================================
--- trunk/libavcodec/sp5xdec.c	(original)
+++ trunk/libavcodec/sp5xdec.c	Sat Sep 29 17:20:22 2007
@@ -72,6 +72,10 @@ static int sp5x_decode_frame(AVCodecCont
     memcpy(recoded+j, &sp5x_data_sos[0], sizeof(sp5x_data_sos));
     j += sizeof(sp5x_data_sos);
 
+    if(avctx->codec_id==CODEC_ID_AMV)
+        for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++)
+            recoded[j++] = buf[i];
+    else
     for (i = 14; i < buf_size && j < buf_size+1024-2; i++)
     {
         recoded[j++] = buf[i];
@@ -194,3 +198,15 @@ AVCodec sp5x_decoder = {
     CODEC_CAP_DR1,
     NULL
 };
+
+AVCodec amv_decoder = {
+    "amv",
+    CODEC_TYPE_VIDEO,
+    CODEC_ID_AMV,
+    sizeof(MJpegDecodeContext),
+    ff_mjpeg_decode_init,
+    NULL,
+    ff_mjpeg_decode_end,
+    sp5x_decode_frame,
+    CODEC_CAP_DR1
+};




More information about the ffmpeg-cvslog mailing list