[x264-devel] [PATCH] More functions forced static

Loic Le Loarer lll+vlc at m4x.org
Sun Aug 3 20:09:25 CEST 2008


When cabac.c and cavlc.c are included in rdo.c, x264_macroblock_write_ca(vlc|bac) are redefined to
x264_macroblock_size_ca(vlc|bac) which are only used once in analyse.c and can be defined static.
Also x264_partition_size_ca(vlc|bac) are only used in analyse.c so deserve a static declaration.

---
 encoder/cabac.c |    5 ++++-
 encoder/cavlc.c |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/encoder/cabac.c b/encoder/cabac.c
index 78736ff..2ee54d9 100644
--- a/encoder/cabac.c
+++ b/encoder/cabac.c
@@ -772,6 +772,9 @@ static void block_residual_write_cabac( x264_t *h, x264_cabac_t *cb, int i_ctxBl
 
 
 
+#ifdef RDO_SKIP_BS
+static
+#endif
 void x264_macroblock_write_cabac( x264_t *h, x264_cabac_t *cb )
 {
     const int i_mb_type = h->mb.i_type;
@@ -1032,7 +1035,7 @@ void x264_macroblock_write_cabac( x264_t *h, x264_cabac_t *cb )
  * works on all partition sizes except 16x16
  * for sub8x8, call once per 8x8 block
  *****************************************************************************/
-void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_pixel )
+static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_pixel )
 {
     const int i_mb_type = h->mb.i_type;
     int j;
diff --git a/encoder/cavlc.c b/encoder/cavlc.c
index e7bc11e..96dbf68 100644
--- a/encoder/cavlc.c
+++ b/encoder/cavlc.c
@@ -306,6 +306,9 @@ static inline void x264_macroblock_luma_write_cavlc( x264_t *h, bs_t *s, int i8s
 /*****************************************************************************
  * x264_macroblock_write:
  *****************************************************************************/
+#ifdef RDO_SKIP_BS
+static
+#endif
 void x264_macroblock_write_cavlc( x264_t *h, bs_t *s )
 {
     const int i_mb_type = h->mb.i_type;
@@ -680,7 +683,7 @@ void x264_macroblock_write_cavlc( x264_t *h, bs_t *s )
  * works on all partition sizes except 16x16
  * for sub8x8, call once per 8x8 block
  *****************************************************************************/
-int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
+static int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
 {
     bs_t s;
     const int i_mb_type = h->mb.i_type;
-- 
1.5.6



More information about the x264-devel mailing list