diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2015-09-03 16:08:29 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2015-09-03 21:19:45 -0400 |
commit | d88cee37124a598e78e7eb17686a89a5533b9520 (patch) | |
tree | ac241092a46898108daa5a4ca415b3e2f30aa025 /vp10/decoder/decodemv.c | |
parent | ecd34e6494599fb44ccc1f68a7c4ee988bc0307c (diff) | |
download | libvpx-d88cee37124a598e78e7eb17686a89a5533b9520.tar libvpx-d88cee37124a598e78e7eb17686a89a5533b9520.tar.gz libvpx-d88cee37124a598e78e7eb17686a89a5533b9520.tar.bz2 libvpx-d88cee37124a598e78e7eb17686a89a5533b9520.zip |
Make update_map/temporal_update fields implicit for keyframes.
These frame types cannot make bitstream parsing depend on previous
frames, so the hypothetical combinations of e.g. keyframe=1 and
update_map=0 or keyframe=1 and temporal_update=1 are non-sensical.
Therefore, make it impossible to code such combinations in the vp10
bitstream header.
See issue 1044.
Change-Id: I3f0a83d5c7e3989541a469a909471424a285239d
Diffstat (limited to 'vp10/decoder/decodemv.c')
-rw-r--r-- | vp10/decoder/decodemv.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/vp10/decoder/decodemv.c b/vp10/decoder/decodemv.c index 681e02f39..b190f734c 100644 --- a/vp10/decoder/decodemv.c +++ b/vp10/decoder/decodemv.c @@ -116,18 +116,6 @@ static void set_segment_id(VP10_COMMON *cm, int mi_offset, cm->current_frame_seg_map[mi_offset + y * cm->mi_cols + x] = segment_id; } -static void copy_segment_id(const VP10_COMMON *cm, - const uint8_t *last_segment_ids, - uint8_t *current_segment_ids, - int mi_offset, int x_mis, int y_mis) { - int x, y; - - for (y = 0; y < y_mis; y++) - for (x = 0; x < x_mis; x++) - current_segment_ids[mi_offset + y * cm->mi_cols + x] = last_segment_ids ? - last_segment_ids[mi_offset + y * cm->mi_cols + x] : 0; -} - static int read_intra_segment_id(VP10_COMMON *const cm, int mi_offset, int x_mis, int y_mis, vpx_reader *r) { @@ -137,17 +125,25 @@ static int read_intra_segment_id(VP10_COMMON *const cm, int mi_offset, if (!seg->enabled) return 0; // Default for disabled segmentation - if (!seg->update_map) { - copy_segment_id(cm, cm->last_frame_seg_map, cm->current_frame_seg_map, - mi_offset, x_mis, y_mis); - return 0; - } + assert(seg->update_map && !seg->temporal_update); segment_id = read_segment_id(r, seg); set_segment_id(cm, mi_offset, x_mis, y_mis, segment_id); return segment_id; } +static void copy_segment_id(const VP10_COMMON *cm, + const uint8_t *last_segment_ids, + uint8_t *current_segment_ids, + int mi_offset, int x_mis, int y_mis) { + int x, y; + + for (y = 0; y < y_mis; y++) + for (x = 0; x < x_mis; x++) + current_segment_ids[mi_offset + y * cm->mi_cols + x] = last_segment_ids ? + last_segment_ids[mi_offset + y * cm->mi_cols + x] : 0; +} + static int read_inter_segment_id(VP10_COMMON *const cm, MACROBLOCKD *const xd, int mi_row, int mi_col, vpx_reader *r) { struct segmentation *const seg = &cm->seg; |