summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-06-20 15:52:47 -0700
committerDmitry Kovalev <dkovalev@google.com>2013-06-21 13:05:10 -0700
commit40141681c05cd9c988f63ddb19688f0ed7a17173 (patch)
treebb0bcaa94380c954956b1e36aed4910dabc48c1b /vp9/encoder
parent7756e9892b312e668fc3134bad2513806d609f73 (diff)
downloadlibvpx-40141681c05cd9c988f63ddb19688f0ed7a17173.tar
libvpx-40141681c05cd9c988f63ddb19688f0ed7a17173.tar.gz
libvpx-40141681c05cd9c988f63ddb19688f0ed7a17173.tar.bz2
libvpx-40141681c05cd9c988f63ddb19688f0ed7a17173.zip
Removing find_seg_id and using vp9_get_pred_mi_segid instead.
Change-Id: Ia40229903c08f14020e90e94cfdf494aba1be827
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_encodeframe.c27
-rw-r--r--vp9/encoder/vp9_segmentation.c1
2 files changed, 4 insertions, 24 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 35e1d646b..e7b5476d9 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -455,25 +455,6 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
}
}
-static unsigned find_seg_id(VP9_COMMON *cm, uint8_t *buf, BLOCK_SIZE_TYPE bsize,
- int start_y, int height, int start_x, int width) {
- const int bw = 1 << mi_width_log2(bsize), bh = 1 << mi_height_log2(bsize);
- const int end_x = MIN(start_x + bw, width);
- const int end_y = MIN(start_y + bh, height);
- int x, y;
- unsigned seg_id = -1;
-
- buf += width * start_y;
- assert(start_y < cm->mi_rows && start_x < cm->cur_tile_mi_col_end);
- for (y = start_y; y < end_y; y++, buf += width) {
- for (x = start_x; x < end_x; x++) {
- seg_id = MIN(seg_id, buf[x]);
- }
- }
-
- return seg_id;
-}
-
void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src,
int mb_row, int mb_col) {
uint8_t *buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer, src
@@ -551,11 +532,9 @@ static void set_offsets(VP9_COMP *cpi, int mi_row, int mi_col,
/* segment ID */
if (xd->segmentation_enabled) {
- uint8_t *map =
- xd->update_mb_segmentation_map ?
- cpi->segmentation_map : cm->last_frame_seg_map;
- mbmi->segment_id = find_seg_id(cm, map, bsize, mi_row, cm->mi_rows, mi_col,
- cm->mi_cols);
+ uint8_t *map = xd->update_mb_segmentation_map ? cpi->segmentation_map
+ : cm->last_frame_seg_map;
+ mbmi->segment_id = vp9_get_pred_mi_segid(cm, bsize, map, mi_row, mi_col);
assert(mbmi->segment_id <= (MAX_MB_SEGMENTS-1));
vp9_mb_init_quantizer(cpi, x);
diff --git a/vp9/encoder/vp9_segmentation.c b/vp9/encoder/vp9_segmentation.c
index fe995ad72..af218b7d6 100644
--- a/vp9/encoder/vp9_segmentation.c
+++ b/vp9/encoder/vp9_segmentation.c
@@ -139,6 +139,7 @@ static void count_segs(VP9_COMP *cpi,
if (cm->frame_type != KEY_FRAME) {
// Test to see if the segment id matches the predicted value.
const int pred_seg_id = vp9_get_pred_mi_segid(cm, mi->mbmi.sb_type,
+ cm->last_frame_seg_map,
mi_row, mi_col);
const int seg_predicted = (segment_id == pred_seg_id);