[SCM] libav/experimental: move ff_mpeg4_find_frame_end() from h263dec.c to mpeg4video_parser.c now h263dec depends on mpeg4video_parser this fixes compilation when h263 decoder is disabled

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:59:42 UTC 2013


The following commit has been merged in the experimental branch:
commit df495dbd9a5fc5053d5e7e6976932bb104cde4a6
Author: Aurelien Jacobs <aurel at gnuage.org>
Date:   Wed May 9 23:13:43 2007 +0000

    move ff_mpeg4_find_frame_end() from h263dec.c to mpeg4video_parser.c
    now h263dec depends on mpeg4video_parser
    this fixes compilation when h263 decoder is disabled
    
    Originally committed as revision 8962 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/configure b/configure
index cd5221b..68f2715 100755
--- a/configure
+++ b/configure
@@ -677,7 +677,7 @@ dxa_decoder_deps="zlib"
 flashsv_decoder_deps="zlib"
 flashsv_encoder_deps="zlib"
 flv_decoder_deps="h263_decoder"
-h263_decoder_deps="h263_parser"
+h263_decoder_deps="h263_parser mpeg4video_parser"
 h263i_decoder_deps="h263_decoder"
 mpeg_xvmc_decoder_deps="xvmc"
 mpeg4_decoder_deps="h263_decoder"
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index cbbb9c5..819866e 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -29,6 +29,7 @@
 #include "dsputil.h"
 #include "mpegvideo.h"
 #include "h263_parser.h"
+#include "mpeg4video_parser.h"
 
 //#define DEBUG
 //#define PRINT_FRAME_TIME
@@ -318,47 +319,6 @@ static int decode_slice(MpegEncContext *s){
     return -1;
 }
 
-/**
- * finds the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
-    int vop_found, i;
-    uint32_t state;
-
-    vop_found= pc->frame_start_found;
-    state= pc->state;
-
-    i=0;
-    if(!vop_found){
-        for(i=0; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if(state == 0x1B6){
-                i++;
-                vop_found=1;
-                break;
-            }
-        }
-    }
-
-    if(vop_found){
-        /* EOF considered as end of frame */
-        if (buf_size == 0)
-            return 0;
-        for(; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if((state&0xFFFFFF00) == 0x100){
-                pc->frame_start_found=0;
-                pc->state=-1;
-                return i-3;
-            }
-        }
-    }
-    pc->frame_start_found= vop_found;
-    pc->state= state;
-    return END_NOT_FOUND;
-}
-
 int ff_h263_decode_frame(AVCodecContext *avctx,
                              void *data, int *data_size,
                              uint8_t *buf, int buf_size)
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index 4771ca0..9accc91 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -22,8 +22,46 @@
 
 #include "parser.h"
 #include "mpegvideo.h"
+#include "mpeg4video_parser.h"
 
 
+int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
+    int vop_found, i;
+    uint32_t state;
+
+    vop_found= pc->frame_start_found;
+    state= pc->state;
+
+    i=0;
+    if(!vop_found){
+        for(i=0; i<buf_size; i++){
+            state= (state<<8) | buf[i];
+            if(state == 0x1B6){
+                i++;
+                vop_found=1;
+                break;
+            }
+        }
+    }
+
+    if(vop_found){
+        /* EOF considered as end of frame */
+        if (buf_size == 0)
+            return 0;
+        for(; i<buf_size; i++){
+            state= (state<<8) | buf[i];
+            if((state&0xFFFFFF00) == 0x100){
+                pc->frame_start_found=0;
+                pc->state=-1;
+                return i-3;
+            }
+        }
+    }
+    pc->frame_start_found= vop_found;
+    pc->state= state;
+    return END_NOT_FOUND;
+}
+
 /* XXX: make it use less memory */
 static int av_mpeg4_decode_header(AVCodecParserContext *s1,
                                   AVCodecContext *avctx,
diff --git a/libavcodec/xvid_internal.h b/libavcodec/mpeg4video_parser.h
similarity index 64%
copy from libavcodec/xvid_internal.h
copy to libavcodec/mpeg4video_parser.h
index 49c59c2..0da1da0 100644
--- a/libavcodec/xvid_internal.h
+++ b/libavcodec/mpeg4video_parser.h
@@ -1,5 +1,7 @@
 /*
- * copyright (C) 2006 Corey Hickey
+ * MPEG4 video parser prototypes
+ * Copyright (c) 2003 Fabrice Bellard.
+ * Copyright (c) 2003 Michael Niedermayer.
  *
  * This file is part of FFmpeg.
  *
@@ -18,15 +20,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef XVID_INTERNAL_H
-#define XVID_INTERNAL_H
+#ifndef MPEG4VIDEO_PARSER_H
+#define MPEG4VIDEO_PARSER_H
+
+#include "parser.h"
 
 /**
- * @file xvid_internal.h
- * common functions for use with the XviD wrappers
+ * finds the end of the current frame in the bitstream.
+ * @return the position of the first byte of the next frame, or -1
  */
+int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
 
-
-int av_tempfile(char *prefix, char **filename);
-
-#endif /* XVID_INTERNAL_H */
+#endif /* MPEG4VIDEO_PARSER_H */
diff --git a/libavcodec/parser.h b/libavcodec/parser.h
index 5cf1fee..8492a0c 100644
--- a/libavcodec/parser.h
+++ b/libavcodec/parser.h
@@ -59,7 +59,4 @@ int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf,
 void ff_parse_close(AVCodecParserContext *s);
 void ff_parse1_close(AVCodecParserContext *s);
 
-/* h263dec.c */
-int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
-
 #endif /* !FFMPEG_PARSER_H */

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list