summaryrefslogtreecommitdiff
path: root/vp9/decoder
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-08-28 14:49:09 -0700
committerYaowu Xu <yaowu@google.com>2013-09-04 09:22:59 -0700
commitd6606d1ea734bbd7b3ab3e0852cedace5e4f0cd6 (patch)
treec8e9dd128ba2e18bccebcdba89457911e21e7e12 /vp9/decoder
parent1cf2272347f8a07b29a0ee2d9d6445826f2f7e6f (diff)
downloadlibvpx-d6606d1ea734bbd7b3ab3e0852cedace5e4f0cd6.tar
libvpx-d6606d1ea734bbd7b3ab3e0852cedace5e4f0cd6.tar.gz
libvpx-d6606d1ea734bbd7b3ab3e0852cedace5e4f0cd6.tar.bz2
libvpx-d6606d1ea734bbd7b3ab3e0852cedace5e4f0cd6.zip
Replacing init_dequantizer() with setup_plane_dequants().
Change-Id: Ib67e996b4a6dcb6f481889f5a0d84811a9e3c5d1
Diffstat (limited to 'vp9/decoder')
-rw-r--r--vp9/decoder/vp9_decodframe.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index 41e406d95..e41ea541d 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -77,14 +77,11 @@ static void read_tx_probs(struct tx_probs *tx_probs, vp9_reader *r) {
vp9_diff_update_prob(r, &tx_probs->p32x32[i][j]);
}
-static void init_dequantizer(VP9_COMMON *cm, MACROBLOCKD *xd) {
+static void setup_plane_dequants(VP9_COMMON *cm, MACROBLOCKD *xd, int q_index) {
int i;
- const int segment_id = xd->mode_info_context->mbmi.segment_id;
- xd->q_index = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex);
-
- xd->plane[0].dequant = cm->y_dequant[xd->q_index];
+ xd->plane[0].dequant = cm->y_dequant[q_index];
for (i = 1; i < MAX_MB_PLANE; i++)
- xd->plane[i].dequant = cm->uv_dequant[xd->q_index];
+ xd->plane[i].dequant = cm->uv_dequant[q_index];
}
static void decode_block(int plane, int block, BLOCK_SIZE plane_bsize,
@@ -149,14 +146,17 @@ static void decode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
}
static int decode_tokens(VP9D_COMP *pbi, BLOCK_SIZE bsize, vp9_reader *r) {
+ VP9_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
+ MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
- if (xd->mode_info_context->mbmi.skip_coeff) {
- reset_skip_context(xd, bsize);
+ if (mbmi->skip_coeff) {
+ reset_skip_context(xd, bsize);
return -1;
} else {
- if (pbi->common.seg.enabled)
- init_dequantizer(&pbi->common, xd);
+ if (cm->seg.enabled)
+ setup_plane_dequants(cm, xd, vp9_get_qindex(&cm->seg, mbmi->segment_id,
+ cm->base_qindex));
// TODO(dkovalev) if (!vp9_reader_has_error(r))
return vp9_decode_tokens(pbi, r, bsize);
@@ -173,6 +173,7 @@ static void set_offsets(VP9D_COMP *pbi, BLOCK_SIZE bsize,
xd->mode_info_context = cm->mi + offset;
xd->mode_info_context->mbmi.sb_type = bsize;
+ xd->mode_info_stride = cm->mode_info_stride;
// Special case: if prev_mi is NULL, the previous mode info context
// cannot be used.
xd->prev_mode_info_context = cm->prev_mi ? cm->prev_mi + offset : NULL;
@@ -958,11 +959,7 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
"Truncated packet or corrupt header length");
- xd->mode_info_context = cm->mi;
- xd->prev_mode_info_context = cm->prev_mi;
- xd->mode_info_stride = cm->mode_info_stride;
-
- init_dequantizer(cm, &pbi->mb);
+ setup_plane_dequants(cm, &pbi->mb, cm->base_qindex);
cm->fc = cm->frame_contexts[cm->frame_context_idx];