summaryrefslogtreecommitdiff
path: root/vp8/decoder
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-06-17 15:36:43 -0400
committerJohn Koleszar <jkoleszar@google.com>2011-06-17 15:36:43 -0400
commitdeb2e9cf620087b4dc5b78423b6ff9bf8971c1bc (patch)
tree592d5eeb0cac290da19d6e660135a0f41dfd1dc3 /vp8/decoder
parentcefb915ab62a7cd91b347cc22449b2eb9b8c1df9 (diff)
parenta60fc419f50eefbef568ceecb93233471e894fa5 (diff)
downloadlibvpx-deb2e9cf620087b4dc5b78423b6ff9bf8971c1bc.tar
libvpx-deb2e9cf620087b4dc5b78423b6ff9bf8971c1bc.tar.gz
libvpx-deb2e9cf620087b4dc5b78423b6ff9bf8971c1bc.tar.bz2
libvpx-deb2e9cf620087b4dc5b78423b6ff9bf8971c1bc.zip
Merge remote branch 'internal/upstream' into HEAD
Conflicts: vp8/encoder/encodeframe.c vp8/encoder/rdopt.c Change-Id: I183fd3ce9e94617ec888c9f891055b9f1f8ca6c5
Diffstat (limited to 'vp8/decoder')
-rw-r--r--vp8/decoder/asm_dec_offsets.c25
-rw-r--r--vp8/decoder/decodemv.c30
-rw-r--r--vp8/decoder/decodframe.c3
-rw-r--r--vp8/decoder/onyxd_if.c1
-rw-r--r--vp8/decoder/threading.c8
-rw-r--r--vp8/decoder/treereader.h23
-rw-r--r--vp8/decoder/x86/x86_dsystemdependent.c6
7 files changed, 17 insertions, 79 deletions
diff --git a/vp8/decoder/asm_dec_offsets.c b/vp8/decoder/asm_dec_offsets.c
index e485cb414..dd2aad2c3 100644
--- a/vp8/decoder/asm_dec_offsets.c
+++ b/vp8/decoder/asm_dec_offsets.c
@@ -9,21 +9,10 @@
*/
-#include "vpx_ports/config.h"
-#include <stddef.h>
-
+#include "vpx_ports/asm_offsets.h"
#include "onyxd_int.h"
-#define DEFINE(sym, val) int sym = val;
-
-/*
-#define BLANK() asm volatile("\n->" : : )
-*/
-
-/*
- * int main(void)
- * {
- */
+BEGIN
DEFINE(detok_scan, offsetof(DETOK, scan));
DEFINE(detok_ptr_block2leftabove, offsetof(DETOK, ptr_block2leftabove));
@@ -49,9 +38,7 @@ DEFINE(bool_decoder_range, offsetof(BOOL_DECODER, range));
DEFINE(tokenextrabits_min_val, offsetof(TOKENEXTRABITS, min_val));
DEFINE(tokenextrabits_length, offsetof(TOKENEXTRABITS, Length));
-//add asserts for any offset that is not supported by assembly code
-//add asserts for any size that is not supported by assembly code
-/*
- * return 0;
- * }
- */
+END
+
+/* add asserts for any offset that is not supported by assembly code */
+/* add asserts for any size that is not supported by assembly code */
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c
index 73d2518cc..485aba053 100644
--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -101,36 +101,6 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_co
}
while (++i < 16);
}
- else
- {
- int BMode;
- int i = 0;
-
- switch (y_mode)
- {
- case DC_PRED:
- BMode = B_DC_PRED;
- break;
- case V_PRED:
- BMode = B_VE_PRED;
- break;
- case H_PRED:
- BMode = B_HE_PRED;
- break;
- case TM_PRED:
- BMode = B_TM_PRED;
- break;
- default:
- BMode = B_DC_PRED;
- break;
- }
-
- do
- {
- m->bmi[i].as_mode = (B_PREDICTION_MODE)BMode;
- }
- while (++i < 16);
- }
m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc, pbi->common.kf_uv_mode_prob);
}
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 2add2c2e1..2086493a4 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -533,7 +533,10 @@ static void stop_token_decoder(VP8D_COMP *pbi)
VP8_COMMON *pc = &pbi->common;
if (pc->multi_token_partition != ONE_PARTITION)
+ {
vpx_free(pbi->mbc);
+ pbi->mbc = NULL;
+ }
}
static void init_frame(VP8D_COMP *pbi)
diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c
index de34055dc..d3d0b9dac 100644
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -132,6 +132,7 @@ void vp8dx_remove_decompressor(VP8D_PTR ptr)
vp8_de_alloc_overlap_lists(pbi);
#endif
vp8_remove_common(&pbi->common);
+ vpx_free(pbi->mbc);
vpx_free(pbi);
}
diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c
index 77c3f1732..c1df823f1 100644
--- a/vp8/decoder/threading.c
+++ b/vp8/decoder/threading.c
@@ -135,7 +135,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int m
mb_init_dequantizer(pbi, xd);
/* do prediction */
- if (xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
+ if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{
vp8mt_build_intra_predictors_mbuv(pbi, xd, mb_row, mb_col);
@@ -181,7 +181,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int m
xd->predictor, xd->dst.y_buffer,
xd->dst.y_stride, xd->eobs, xd->block[24].diff);
}
- else if ((xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) && xd->mode_info_context->mbmi.mode == B_PRED)
+ else if (xd->mode_info_context->mbmi.mode == B_PRED)
{
for (i = 0; i < 16; i++)
{
@@ -334,7 +334,7 @@ static THREAD_FUNCTION thread_decoding_proc(void *p_data)
{
MODE_INFO *next = xd->mode_info_context +1;
- if (xd->frame_type == KEY_FRAME || next->mbmi.ref_frame == INTRA_FRAME)
+ if (next->mbmi.ref_frame == INTRA_FRAME)
{
for (i = 0; i < 16; i++)
pbi->mt_yleft_col[mb_row][i] = xd->dst.y_buffer [i* recon_y_stride + 15];
@@ -824,7 +824,7 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
{
MODE_INFO *next = xd->mode_info_context +1;
- if (xd->frame_type == KEY_FRAME || next->mbmi.ref_frame == INTRA_FRAME)
+ if (next->mbmi.ref_frame == INTRA_FRAME)
{
for (i = 0; i < 16; i++)
pbi->mt_yleft_col[mb_row][i] = xd->dst.y_buffer [i* recon_y_stride + 15];
diff --git a/vp8/decoder/treereader.h b/vp8/decoder/treereader.h
index b50a4d2ff..238ff8536 100644
--- a/vp8/decoder/treereader.h
+++ b/vp8/decoder/treereader.h
@@ -38,27 +38,4 @@ static int vp8_treed_read(
return -i;
}
-
-/* Variant reads a binary number given distributions on each bit.
- Note that tree is arbitrary; probability of decoding a zero
- may or may not depend on previously decoded bits. */
-
-static int vp8_treed_read_num(
- vp8_reader *const r, /* !!! must return a 0 or 1 !!! */
- vp8_tree t,
- const vp8_prob *const p
-)
-{
- vp8_tree_index i = 0;
- int v = 0, b;
-
- do
- {
- b = vp8_read(r, p[i>>1]);
- v = (v << 1) + b;
- }
- while ((i = t[i+b]) > 0);
-
- return v;
-}
#endif /* tree_reader_h */
diff --git a/vp8/decoder/x86/x86_dsystemdependent.c b/vp8/decoder/x86/x86_dsystemdependent.c
index 5c1684230..a244a3a98 100644
--- a/vp8/decoder/x86/x86_dsystemdependent.c
+++ b/vp8/decoder/x86/x86_dsystemdependent.c
@@ -17,7 +17,7 @@
#if HAVE_MMX
void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q);
-static void dequantize_b_mmx(BLOCKD *d)
+void vp8_dequantize_b_mmx(BLOCKD *d)
{
short *sq = (short *) d->qcoeff;
short *dq = (short *) d->dqcoeff;
@@ -28,6 +28,7 @@ static void dequantize_b_mmx(BLOCKD *d)
void vp8_arch_x86_decode_init(VP8D_COMP *pbi)
{
+#if CONFIG_RUNTIME_CPU_DETECT
int flags = x86_simd_caps();
/* Note:
@@ -36,12 +37,11 @@ void vp8_arch_x86_decode_init(VP8D_COMP *pbi)
* you modify any of the function mappings present in this file, be sure
* to also update them in static mapings (<arch>/filename_<arch>.h)
*/
-#if CONFIG_RUNTIME_CPU_DETECT
/* Override default functions with fastest ones for this CPU. */
#if HAVE_MMX
if (flags & HAS_MMX)
{
- pbi->dequant.block = dequantize_b_mmx;
+ pbi->dequant.block = vp8_dequantize_b_mmx;
pbi->dequant.idct_add = vp8_dequant_idct_add_mmx;
pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_mmx;
pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_mmx;