[FFmpeg-cvslog] r21102 - in trunk/libavcodec: h263dec.c mpegvideo.h msmpeg4.c vc1dec.c wmv2dec.c

michael subversion
Fri Jan 8 20:40:11 CET 2010


Author: michael
Date: Fri Jan  8 20:40:10 2010
New Revision: 21102

Log:
Move AVCodecs from h263dec.c to msmpeg4.c and disentangle init decode init.

Modified:
   trunk/libavcodec/h263dec.c
   trunk/libavcodec/mpegvideo.h
   trunk/libavcodec/msmpeg4.c
   trunk/libavcodec/vc1dec.c
   trunk/libavcodec/wmv2dec.c

Modified: trunk/libavcodec/h263dec.c
==============================================================================
--- trunk/libavcodec/h263dec.c	Fri Jan  8 20:10:11 2010	(r21101)
+++ trunk/libavcodec/h263dec.c	Fri Jan  8 20:40:10 2010	(r21102)
@@ -114,9 +114,6 @@ av_cold int ff_h263_decode_init(AVCodecC
         if (MPV_common_init(s) < 0)
             return -1;
 
-    if (CONFIG_MSMPEG4_DECODER && s->h263_msmpeg4)
-        ff_msmpeg4_decode_init(s);
-
         h263_decode_init_vlc(s);
 
     return 0;
@@ -741,59 +738,3 @@ AVCodec h263_decoder = {
     .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
     .pix_fmts= ff_hwaccel_pixfmt_list_420,
 };
-
-AVCodec msmpeg4v1_decoder = {
-    "msmpeg4v1",
-    CODEC_TYPE_VIDEO,
-    CODEC_ID_MSMPEG4V1,
-    sizeof(MpegEncContext),
-    ff_h263_decode_init,
-    NULL,
-    ff_h263_decode_end,
-    ff_h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 1"),
-    .pix_fmts= ff_pixfmt_list_420,
-};
-
-AVCodec msmpeg4v2_decoder = {
-    "msmpeg4v2",
-    CODEC_TYPE_VIDEO,
-    CODEC_ID_MSMPEG4V2,
-    sizeof(MpegEncContext),
-    ff_h263_decode_init,
-    NULL,
-    ff_h263_decode_end,
-    ff_h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
-    .pix_fmts= ff_pixfmt_list_420,
-};
-
-AVCodec msmpeg4v3_decoder = {
-    "msmpeg4",
-    CODEC_TYPE_VIDEO,
-    CODEC_ID_MSMPEG4V3,
-    sizeof(MpegEncContext),
-    ff_h263_decode_init,
-    NULL,
-    ff_h263_decode_end,
-    ff_h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
-    .pix_fmts= ff_pixfmt_list_420,
-};
-
-AVCodec wmv1_decoder = {
-    "wmv1",
-    CODEC_TYPE_VIDEO,
-    CODEC_ID_WMV1,
-    sizeof(MpegEncContext),
-    ff_h263_decode_init,
-    NULL,
-    ff_h263_decode_end,
-    ff_h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"),
-    .pix_fmts= ff_pixfmt_list_420,
-};

Modified: trunk/libavcodec/mpegvideo.h
==============================================================================
--- trunk/libavcodec/mpegvideo.h	Fri Jan  8 20:10:11 2010	(r21101)
+++ trunk/libavcodec/mpegvideo.h	Fri Jan  8 20:40:10 2010	(r21102)
@@ -860,7 +860,7 @@ void msmpeg4_encode_mb(MpegEncContext * 
                        int motion_x, int motion_y);
 int msmpeg4_decode_picture_header(MpegEncContext * s);
 int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);
-int ff_msmpeg4_decode_init(MpegEncContext *s);
+int ff_msmpeg4_decode_init(AVCodecContext *avctx);
 void ff_msmpeg4_encode_init(MpegEncContext *s);
 int ff_wmv2_decode_picture_header(MpegEncContext * s);
 int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s);

Modified: trunk/libavcodec/msmpeg4.c
==============================================================================
--- trunk/libavcodec/msmpeg4.c	Fri Jan  8 20:10:11 2010	(r21101)
+++ trunk/libavcodec/msmpeg4.c	Fri Jan  8 20:40:10 2010	(r21102)
@@ -1272,12 +1272,15 @@ static int msmpeg4v34_decode_mb(MpegEncC
 }
 
 /* init all vlc decoding tables */
-av_cold int ff_msmpeg4_decode_init(MpegEncContext *s)
+av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
 {
+    MpegEncContext *s = avctx->priv_data;
     static int done = 0;
     int i;
     MVTable *mv;
 
+    ff_h263_decode_init(avctx);
+
     common_init(s);
 
     if (!done) {
@@ -1917,3 +1920,59 @@ int ff_msmpeg4_decode_motion(MpegEncCont
     *my_ptr = my;
     return 0;
 }
+
+AVCodec msmpeg4v1_decoder = {
+    "msmpeg4v1",
+    CODEC_TYPE_VIDEO,
+    CODEC_ID_MSMPEG4V1,
+    sizeof(MpegEncContext),
+    ff_msmpeg4_decode_init,
+    NULL,
+    ff_h263_decode_end,
+    ff_h263_decode_frame,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+    .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 1"),
+    .pix_fmts= ff_pixfmt_list_420,
+};
+
+AVCodec msmpeg4v2_decoder = {
+    "msmpeg4v2",
+    CODEC_TYPE_VIDEO,
+    CODEC_ID_MSMPEG4V2,
+    sizeof(MpegEncContext),
+    ff_msmpeg4_decode_init,
+    NULL,
+    ff_h263_decode_end,
+    ff_h263_decode_frame,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+    .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
+    .pix_fmts= ff_pixfmt_list_420,
+};
+
+AVCodec msmpeg4v3_decoder = {
+    "msmpeg4",
+    CODEC_TYPE_VIDEO,
+    CODEC_ID_MSMPEG4V3,
+    sizeof(MpegEncContext),
+    ff_msmpeg4_decode_init,
+    NULL,
+    ff_h263_decode_end,
+    ff_h263_decode_frame,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+    .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
+    .pix_fmts= ff_pixfmt_list_420,
+};
+
+AVCodec wmv1_decoder = {
+    "wmv1",
+    CODEC_TYPE_VIDEO,
+    CODEC_ID_WMV1,
+    sizeof(MpegEncContext),
+    ff_msmpeg4_decode_init,
+    NULL,
+    ff_h263_decode_end,
+    ff_h263_decode_frame,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+    .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"),
+    .pix_fmts= ff_pixfmt_list_420,
+};

Modified: trunk/libavcodec/vc1dec.c
==============================================================================
--- trunk/libavcodec/vc1dec.c	Fri Jan  8 20:10:11 2010	(r21101)
+++ trunk/libavcodec/vc1dec.c	Fri Jan  8 20:40:10 2010	(r21102)
@@ -2997,7 +2997,7 @@ static av_cold int vc1_decode_init(AVCod
         return -1;
     if (vc1_init_common(v) < 0) return -1;
     // only for ff_msmp4_mb_i_table
-    if (ff_msmpeg4_decode_init(s) < 0) return -1;
+    if (ff_msmpeg4_decode_init(avctx) < 0) return -1;
 
     avctx->coded_width = avctx->width;
     avctx->coded_height = avctx->height;

Modified: trunk/libavcodec/wmv2dec.c
==============================================================================
--- trunk/libavcodec/wmv2dec.c	Fri Jan  8 20:10:11 2010	(r21101)
+++ trunk/libavcodec/wmv2dec.c	Fri Jan  8 20:40:10 2010	(r21102)
@@ -465,7 +465,7 @@ static av_cold int wmv2_decode_init(AVCo
         avctx->idct_algo=FF_IDCT_WMV2;
     }
 
-    if(ff_h263_decode_init(avctx) < 0)
+    if(ff_msmpeg4_decode_init(avctx) < 0)
         return -1;
 
     ff_wmv2_common_init(w);



More information about the ffmpeg-cvslog mailing list