ref: 22f56b93e58e04b0a68bc226437ed129559b85e6
parent: 3e32105d63c0a15198b0b4e1172c1c934e1c5b7d
author: John Koleszar <jkoleszar@google.com>
date: Fri May 4 05:46:57 EDT 2012
Formalize encodeframe.c forward delclarations 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
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -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 @@
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 @@
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;
--- /dev/null
+++ b/vp8/encoder/encodeframe.h
@@ -1,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
--- a/vp8/encoder/ethreading.c
+++ b/vp8/encoder/ethreading.c
@@ -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_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);
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -28,11 +28,10 @@
#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);
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -36,6 +36,7 @@
#if CONFIG_MULTI_RES_ENCODING
#include "mr_dissim.h"
#endif
+#include "encodeframe.h"
#include <math.h>
#include <stdio.h>
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -693,11 +693,7 @@
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);
--- a/vp8/vp8cx.mk
+++ b/vp8/vp8cx.mk
@@ -39,6 +39,7 @@
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
--
⑨