summaryrefslogtreecommitdiff
path: root/vp8/encoder/rdopt.c
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-03-17 17:07:59 -0400
committerJohn Koleszar <jkoleszar@google.com>2011-03-17 20:53:47 -0400
commit429dc676b19ff8dbb5864e3c436de1b214e538b0 (patch)
treeaf0706b473fba2ada97ea22e30adc26e5435fcb9 /vp8/encoder/rdopt.c
parent71bcd9f1af91f2dea22f2e71839039d83e5b1d84 (diff)
downloadlibvpx-429dc676b19ff8dbb5864e3c436de1b214e538b0.tar
libvpx-429dc676b19ff8dbb5864e3c436de1b214e538b0.tar.gz
libvpx-429dc676b19ff8dbb5864e3c436de1b214e538b0.tar.bz2
libvpx-429dc676b19ff8dbb5864e3c436de1b214e538b0.zip
Increase static linkage, remove unused functions
A large number of functions were defined with external linkage, even though they were only used from within one file. This patch changes their linkage to static and removes the vp8_ prefix from their names, which should make it more obvious to the reader that the function is contained within the current translation unit. Functions that were not referenced were removed. These symbols were identified by: $ nm -A libvpx.a | sort -k3 | uniq -c -f2 | grep ' [A-Z] ' \ | sort | grep '^ *1 ' Change-Id: I59609f58ab65312012c047036ae1e0634f795779
Diffstat (limited to 'vp8/encoder/rdopt.c')
-rw-r--r--vp8/encoder/rdopt.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c
index c706c575f..a125cc481 100644
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -53,7 +53,7 @@ extern void vp8_update_zbin_extra(VP8_COMP *cpi, MACROBLOCK *x);
-const int vp8_auto_speed_thresh[17] =
+static const int auto_speed_thresh[17] =
{
1000,
200,
@@ -353,7 +353,7 @@ void vp8_auto_select_speed(VP8_COMP *cpi)
}
}
- if (milliseconds_for_compress * 100 > cpi->avg_encode_time * vp8_auto_speed_thresh[cpi->Speed])
+ if (milliseconds_for_compress * 100 > cpi->avg_encode_time * auto_speed_thresh[cpi->Speed])
{
cpi->Speed -= 1;
cpi->avg_pick_mode_time = 0;
@@ -1000,13 +1000,6 @@ static unsigned int vp8_encode_inter_mb_segment(MACROBLOCK *x, int const *labels
return distortion;
}
-unsigned char vp8_mbsplit_offset2[4][16] = {
- { 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 0, 2, 8, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
-};
-
static const unsigned int segmentation_to_sseshift[4] = {3, 3, 2, 0};
@@ -1034,8 +1027,8 @@ typedef struct
} BEST_SEG_INFO;
-void vp8_rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x, BEST_SEG_INFO *bsi,
- unsigned int segmentation)
+static void rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x,
+ BEST_SEG_INFO *bsi, unsigned int segmentation)
{
int i;
int const *labels;
@@ -1153,7 +1146,7 @@ void vp8_rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x, BEST_SEG_INFO *bsi,
int sadpb = x->sadperbit4;
// find first label
- n = vp8_mbsplit_offset2[segmentation][i];
+ n = vp8_mbsplit_offset[segmentation][i];
c = &x->block[n];
e = &x->e_mbd.block[n];
@@ -1332,16 +1325,16 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
{
/* for now, we will keep the original segmentation order
when in best quality mode */
- vp8_rd_check_segment(cpi, x, &bsi, BLOCK_16X8);
- vp8_rd_check_segment(cpi, x, &bsi, BLOCK_8X16);
- vp8_rd_check_segment(cpi, x, &bsi, BLOCK_8X8);
- vp8_rd_check_segment(cpi, x, &bsi, BLOCK_4X4);
+ rd_check_segment(cpi, x, &bsi, BLOCK_16X8);
+ rd_check_segment(cpi, x, &bsi, BLOCK_8X16);
+ rd_check_segment(cpi, x, &bsi, BLOCK_8X8);
+ rd_check_segment(cpi, x, &bsi, BLOCK_4X4);
}
else
{
int sr;
- vp8_rd_check_segment(cpi, x, &bsi, BLOCK_8X8);
+ rd_check_segment(cpi, x, &bsi, BLOCK_8X8);
if (bsi.segment_rd < best_rd)
{
@@ -1380,7 +1373,7 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
sr = MAXF((abs(bsi.sv_mvp[1].row - bsi.sv_mvp[3].row))>>3, (abs(bsi.sv_mvp[1].col - bsi.sv_mvp[3].col))>>3);
vp8_cal_step_param(sr, &bsi.sv_istep[1]);
- vp8_rd_check_segment(cpi, x, &bsi, BLOCK_8X16);
+ rd_check_segment(cpi, x, &bsi, BLOCK_8X16);
}
/* block 16X8 */
@@ -1391,7 +1384,7 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
sr = MAXF((abs(bsi.sv_mvp[2].row - bsi.sv_mvp[3].row))>>3, (abs(bsi.sv_mvp[2].col - bsi.sv_mvp[3].col))>>3);
vp8_cal_step_param(sr, &bsi.sv_istep[1]);
- vp8_rd_check_segment(cpi, x, &bsi, BLOCK_16X8);
+ rd_check_segment(cpi, x, &bsi, BLOCK_16X8);
}
/* If 8x8 is better than 16x8/8x16, then do 4x4 search */
@@ -1399,7 +1392,7 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
if (cpi->sf.no_skip_block4x4_search || bsi.segment_num == BLOCK_8X8) /* || (sv_segment_rd8x8-bsi.segment_rd) < sv_segment_rd8x8>>5) */
{
bsi.mvp = &bsi.sv_mvp[0];
- vp8_rd_check_segment(cpi, x, &bsi, BLOCK_4X4);
+ rd_check_segment(cpi, x, &bsi, BLOCK_4X4);
}
/* restore UMV window */
@@ -1432,7 +1425,7 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
{
int j;
- j = vp8_mbsplit_offset2[bsi.segment_num][i];
+ j = vp8_mbsplit_offset[bsi.segment_num][i];
x->partition_info->bmi[i].mode = x->e_mbd.block[j].bmi.mode;
x->partition_info->bmi[i].mv.as_mv = x->e_mbd.block[j].bmi.mv.as_mv;