Formalize encodeframe.c forward delclarations
authorJohn Koleszar <jkoleszar@google.com>
Fri, 4 May 2012 16:46:57 +0000 (09:46 -0700)
committerJohn Koleszar <jkoleszar@google.com>
Fri, 4 May 2012 17:44:47 +0000 (10:44 -0700)
Change If4321cc5 fixed a bug caused by forward declarations not being
kept in sync across C files, resulting in a function call with the
wrong arguments. The commit moves the affected function declarations
into a header file, along with the other symbols from encodeframe.c
that were being sloppily shared.

Change-Id: I76a7b4c66d4fe175f9cbef7e52148655e4bb9ba1

vp8/encoder/encodeframe.c
vp8/encoder/encodeframe.h [new file with mode: 0644]
vp8/encoder/ethreading.c
vp8/encoder/firstpass.c
vp8/encoder/onyx_if.c
vp8/encoder/onyx_int.h
vp8/vp8cx.mk

index d6b0ba8..8233873 100644 (file)
@@ -31,6 +31,7 @@
 #if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING
 #include "bitstream.h"
 #endif
+#include "encodeframe.h"
 
 extern void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t) ;
 extern void vp8_calc_ref_frame_costs(int *ref_frame_cost,
@@ -46,13 +47,6 @@ extern void vp8cx_init_mbrthread_data(VP8_COMP *cpi,
                                       MB_ROW_COMP *mbr_ei,
                                       int mb_row,
                                       int count);
-void vp8_build_block_offsets(MACROBLOCK *x);
-void vp8_setup_block_ptrs(MACROBLOCK *x);
-int vp8cx_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
-                                  int recon_yoffset, int recon_uvoffset,
-                                  int mb_row, int mb_col);
-int vp8cx_encode_intra_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
-                                   TOKENEXTRA **t);
 static void adjust_act_zbin( VP8_COMP *cpi, MACROBLOCK *x );
 
 #ifdef MODE_STATS
@@ -596,7 +590,7 @@ void encode_mb_row(VP8_COMP *cpi,
     x->partition_info++;
 }
 
-void init_encode_frame_mb_context(VP8_COMP *cpi)
+static void init_encode_frame_mb_context(VP8_COMP *cpi)
 {
     MACROBLOCK *const x = & cpi->mb;
     VP8_COMMON *const cm = & cpi->common;
diff --git a/vp8/encoder/encodeframe.h b/vp8/encoder/encodeframe.h
new file mode 100644 (file)
index 0000000..4dd6ba0
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ *  Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+#ifndef ENCODEFRAME_H
+#define ENCODEFRAME_H
+extern void vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x);
+
+extern void vp8_build_block_offsets(MACROBLOCK *x);
+
+extern void vp8_setup_block_ptrs(MACROBLOCK *x);
+
+extern void vp8_encode_frame(VP8_COMP *cpi);
+
+extern int vp8cx_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
+        TOKENEXTRA **t,
+        int recon_yoffset, int recon_uvoffset,
+        int mb_row, int mb_col);
+
+extern int vp8cx_encode_intra_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
+        TOKENEXTRA **t);
+#endif
index baa29cf..2a2cb2f 100644 (file)
@@ -12,8 +12,8 @@
 #include "vp8/common/threading.h"
 #include "vp8/common/common.h"
 #include "vp8/common/extend.h"
-
 #include "bitstream.h"
+#include "encodeframe.h"
 
 #if CONFIG_MULTITHREAD
 
@@ -24,8 +24,6 @@ extern int vp8cx_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
 extern int vp8cx_encode_intra_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
                                          TOKENEXTRA **t);
 extern void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip);
-extern void vp8_build_block_offsets(MACROBLOCK *x);
-extern void vp8_setup_block_ptrs(MACROBLOCK *x);
 
 extern void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm);
 
index c7211a3..48bdce8 100644 (file)
 #include "rdopt.h"
 #include "vp8/common/quant_common.h"
 #include "encodemv.h"
+#include "encodeframe.h"
 
 //#define OUTPUT_FPF 1
 
-extern void vp8_build_block_offsets(MACROBLOCK *x);
-extern void vp8_setup_block_ptrs(MACROBLOCK *x);
 extern void vp8cx_frame_init_quantizer(VP8_COMP *cpi);
 extern void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv);
 extern void vp8_alloc_compressor_data(VP8_COMP *cpi);
index 7c8740f..8a59e1d 100644 (file)
@@ -36,6 +36,7 @@
 #if CONFIG_MULTI_RES_ENCODING
 #include "mr_dissim.h"
 #endif
+#include "encodeframe.h"
 
 #include <math.h>
 #include <stdio.h>
index 364a46d..900141b 100644 (file)
@@ -693,12 +693,8 @@ typedef struct VP8_COMP
 
 void control_data_rate(VP8_COMP *cpi);
 
-void vp8_encode_frame(VP8_COMP *cpi);
-
 void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned char *dest_end, unsigned long *size);
 
-void vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x);
-
 int rd_cost_intra_mb(MACROBLOCKD *x);
 
 void vp8_tokenize_mb(VP8_COMP *, MACROBLOCKD *, TOKENEXTRA **);
index b7f3494..019edbd 100644 (file)
@@ -39,6 +39,7 @@ VP8_CX_SRCS-yes += encoder/bitstream.c
 VP8_CX_SRCS-yes += encoder/boolhuff.c
 VP8_CX_SRCS-yes += encoder/dct.c
 VP8_CX_SRCS-yes += encoder/encodeframe.c
+VP8_CX_SRCS-yes += encoder/encodeframe.h
 VP8_CX_SRCS-yes += encoder/encodeintra.c
 VP8_CX_SRCS-yes += encoder/encodemb.c
 VP8_CX_SRCS-yes += encoder/encodemv.c