summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2019-05-01 12:10:53 -0700
committerJohann <johannkoenig@google.com>2019-05-01 12:11:46 -0700
commitd79ef289f185b27e30b40a8f72a1331e99d1b8bf (patch)
tree9687bc879f4a5d68d89d8c35b24c72483ef3c4db
parente5f2e06a20a9c9040ca1ae080ade70d88c93e3f6 (diff)
downloadlibvpx-d79ef289f185b27e30b40a8f72a1331e99d1b8bf.tar
libvpx-d79ef289f185b27e30b40a8f72a1331e99d1b8bf.tar.gz
libvpx-d79ef289f185b27e30b40a8f72a1331e99d1b8bf.tar.bz2
libvpx-d79ef289f185b27e30b40a8f72a1331e99d1b8bf.zip
vp8: quiet conversion warnings when packing bits
Mask the values to show that we only want to store 1 byte. Switch to lowercase ff since it's more prevalent in the file. BUG=webm:1615 Change-Id: Ia8ede79cb3a4a39c868198ae207d606e30cfb1cb
-rw-r--r--vp8/encoder/bitstream.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c
index c28e93c28..64bf0a79e 100644
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -1050,11 +1050,11 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest,
* 16 bits : (2 bits Vertical Scale << 14) | Height (14 bits)
*/
v = (pc->horiz_scale << 14) | pc->Width;
- cx_data[3] = v & 0xFF;
+ cx_data[3] = v & 0xff;
cx_data[4] = v >> 8;
v = (pc->vert_scale << 14) | pc->Height;
- cx_data[5] = v & 0xFF;
+ cx_data[5] = v & 0xff;
cx_data[6] = v >> 8;
extra_bytes_packed = 7;
@@ -1268,11 +1268,30 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest,
/* update frame tag */
{
+ /* Pack partition size, show frame, version and frame type into to 24 bits.
+ * Store it 8 bits at a time.
+ * https://tools.ietf.org/html/rfc6386
+ * 9.1. Uncompressed Data Chunk
+ * The uncompressed data chunk comprises a common (for key frames and
+ * interframes) 3-byte frame tag that contains four fields, as follows:
+ *
+ * 1. A 1-bit frame type (0 for key frames, 1 for interframes).
+ *
+ * 2. A 3-bit version number (0 - 3 are defined as four different
+ * profiles with different decoding complexity; other values may be
+ * defined for future variants of the VP8 data format).
+ *
+ * 3. A 1-bit show_frame flag (0 when current frame is not for display,
+ * 1 when current frame is for display).
+ *
+ * 4. A 19-bit field containing the size of the first data partition in
+ * bytes
+ */
int v = (oh.first_partition_length_in_bytes << 5) | (oh.show_frame << 4) |
(oh.version << 1) | oh.type;
- dest[0] = v;
- dest[1] = v >> 8;
+ dest[0] = v & 0xff;
+ dest[1] = (v >> 8) & 0xff;
dest[2] = v >> 16;
}