summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_decodeframe.c
diff options
context:
space:
mode:
authorScott LaVarnway <slavarnway@google.com>2015-11-23 14:42:15 -0800
committerScott LaVarnway <slavarnway@google.com>2015-11-23 14:42:15 -0800
commit2c3b737af64f61113725211100e0f330e9e73213 (patch)
treea4bdc8169c237998de1c3985cc847dd63c13eb17 /vp9/decoder/vp9_decodeframe.c
parent16eba81f6955adf8b60fd7a71b775ee004f970ba (diff)
downloadlibvpx-2c3b737af64f61113725211100e0f330e9e73213.tar
libvpx-2c3b737af64f61113725211100e0f330e9e73213.tar.gz
libvpx-2c3b737af64f61113725211100e0f330e9e73213.tar.bz2
libvpx-2c3b737af64f61113725211100e0f330e9e73213.zip
VP9: Only zero counts when !frame_parallel_decoding_mode (2)
The counts are never used when frame_parallel_decoding_mode is set. Change-Id: I293aa68abadcdd30973adacb9f5f5a3aecf8daa2
Diffstat (limited to 'vp9/decoder/vp9_decodeframe.c')
-rw-r--r--vp9/decoder/vp9_decodeframe.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index f1916639b..39e4dcfe3 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -1979,6 +1979,8 @@ static size_t read_uncompressed_header(VP9Decoder *pbi,
if (!cm->error_resilient_mode) {
cm->refresh_frame_context = vpx_rb_read_bit(rb);
cm->frame_parallel_decoding_mode = vpx_rb_read_bit(rb);
+ if (!cm->frame_parallel_decoding_mode)
+ vp9_zero(cm->counts);
} else {
cm->refresh_frame_context = 0;
cm->frame_parallel_decoding_mode = 1;
@@ -2082,43 +2084,6 @@ static int read_compressed_header(VP9Decoder *pbi, const uint8_t *data,
return vpx_reader_has_error(&r);
}
-#ifdef NDEBUG
-#define debug_check_frame_counts(cm) (void)0
-#else // !NDEBUG
-// Counts should only be incremented when frame_parallel_decoding_mode and
-// error_resilient_mode are disabled.
-static void debug_check_frame_counts(const VP9_COMMON *const cm) {
- FRAME_COUNTS zero_counts;
- vp9_zero(zero_counts);
- assert(cm->frame_parallel_decoding_mode || cm->error_resilient_mode);
- assert(!memcmp(cm->counts.y_mode, zero_counts.y_mode,
- sizeof(cm->counts.y_mode)));
- assert(!memcmp(cm->counts.uv_mode, zero_counts.uv_mode,
- sizeof(cm->counts.uv_mode)));
- assert(!memcmp(cm->counts.partition, zero_counts.partition,
- sizeof(cm->counts.partition)));
- assert(!memcmp(cm->counts.coef, zero_counts.coef,
- sizeof(cm->counts.coef)));
- assert(!memcmp(cm->counts.eob_branch, zero_counts.eob_branch,
- sizeof(cm->counts.eob_branch)));
- assert(!memcmp(cm->counts.switchable_interp, zero_counts.switchable_interp,
- sizeof(cm->counts.switchable_interp)));
- assert(!memcmp(cm->counts.inter_mode, zero_counts.inter_mode,
- sizeof(cm->counts.inter_mode)));
- assert(!memcmp(cm->counts.intra_inter, zero_counts.intra_inter,
- sizeof(cm->counts.intra_inter)));
- assert(!memcmp(cm->counts.comp_inter, zero_counts.comp_inter,
- sizeof(cm->counts.comp_inter)));
- assert(!memcmp(cm->counts.single_ref, zero_counts.single_ref,
- sizeof(cm->counts.single_ref)));
- assert(!memcmp(cm->counts.comp_ref, zero_counts.comp_ref,
- sizeof(cm->counts.comp_ref)));
- assert(!memcmp(&cm->counts.tx, &zero_counts.tx, sizeof(cm->counts.tx)));
- assert(!memcmp(cm->counts.skip, zero_counts.skip, sizeof(cm->counts.skip)));
- assert(!memcmp(&cm->counts.mv, &zero_counts.mv, sizeof(cm->counts.mv)));
-}
-#endif // NDEBUG
-
static struct vpx_read_bit_buffer *init_read_bit_buffer(
VP9Decoder *pbi,
struct vpx_read_bit_buffer *rb,
@@ -2202,8 +2167,6 @@ void vp9_decode_frame(VP9Decoder *pbi,
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
"Uninitialized entropy context.");
- vp9_zero(cm->counts);
-
xd->corrupted = 0;
new_fb->corrupted = read_compressed_header(pbi, data, first_partition_size);
if (new_fb->corrupted)
@@ -2259,8 +2222,6 @@ void vp9_decode_frame(VP9Decoder *pbi,
vp9_adapt_mode_probs(cm);
vp9_adapt_mv_probs(cm, cm->allow_high_precision_mv);
}
- } else {
- debug_check_frame_counts(cm);
}
} else {
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,