From 5d011cb2785016de7f1cbf9a284cdd768a8a6229 Mon Sep 17 00:00:00 2001 From: hui su Date: Tue, 15 Sep 2015 12:44:13 -0700 Subject: VP10: Add palette mode part 1 Add palette mode for keyframe luma channel. Palette mode is enabled when using "--tune-content=screen" in encoding config parameters. on screen_content testset: +6.89% on derlr : +0.00% Design doc (WIP): https://goo.gl/lD4yJw Change-Id: Ib368b216bfd3ea21c6c27436934ad87afdaa6f88 --- vp10/decoder/decodeframe.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vp10/decoder/decodeframe.c') diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c index ad02c953e..f19508c77 100644 --- a/vp10/decoder/decodeframe.c +++ b/vp10/decoder/decodeframe.c @@ -847,6 +847,9 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd, const int max_blocks_high = num_4x4_h + (xd->mb_to_bottom_edge >= 0 ? 0 : xd->mb_to_bottom_edge >> (5 + pd->subsampling_y)); + if (plane <= 1 && mbmi->palette_mode_info.palette_size[plane]) + vp10_decode_palette_tokens(xd, plane, r); + for (row = 0; row < max_blocks_high; row += step) for (col = 0; col < max_blocks_wide; col += step) predict_and_reconstruct_intra_block(xd, r, mbmi, plane, @@ -1535,6 +1538,8 @@ static const uint8_t *decode_tiles(VP10Decoder *pbi, &tile_data->bit_reader, pbi->decrypt_cb, pbi->decrypt_state); vp10_init_macroblockd(cm, &tile_data->xd, tile_data->dqcoeff); + tile_data->xd.plane[0].color_index_map = tile_data->color_index_map[0]; + tile_data->xd.plane[1].color_index_map = tile_data->color_index_map[1]; } } @@ -1757,6 +1762,8 @@ static const uint8_t *decode_tiles_mt(VP10Decoder *pbi, &tile_data->bit_reader, pbi->decrypt_cb, pbi->decrypt_state); vp10_init_macroblockd(cm, &tile_data->xd, tile_data->dqcoeff); + tile_data->xd.plane[0].color_index_map = tile_data->color_index_map[0]; + tile_data->xd.plane[1].color_index_map = tile_data->color_index_map[1]; worker->had_error = 0; if (i == num_workers - 1 || n == tile_cols - 1) { @@ -1926,6 +1933,8 @@ static size_t read_uncompressed_header(VP10Decoder *pbi, memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map)); pbi->need_resync = 0; } + if (cm->current_video_frame == 0) + cm->allow_screen_content_tools = vpx_rb_read_bit(rb); } else { cm->intra_only = cm->show_frame ? 0 : vpx_rb_read_bit(rb); -- cgit v1.2.3