summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann Koenig <johannkoenig@google.com>2019-04-30 16:46:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-04-30 16:46:59 +0000
commit1d0dedf75921c894895e6674993ba5fd4516b7e2 (patch)
tree88e0e6b0789026703bbe7ec5568104a8dcc66332
parent9012ebc269c789586ca33d9a771df134de4a2c6a (diff)
parent9a81785e4228a9cbf944dcf94127f8ec29bf9b6d (diff)
downloadlibvpx-1d0dedf75921c894895e6674993ba5fd4516b7e2.tar
libvpx-1d0dedf75921c894895e6674993ba5fd4516b7e2.tar.gz
libvpx-1d0dedf75921c894895e6674993ba5fd4516b7e2.tar.bz2
libvpx-1d0dedf75921c894895e6674993ba5fd4516b7e2.zip
Merge "vp8: quiet conversion warning when packing sizes"
-rw-r--r--vp8/encoder/bitstream.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c
index 8dd042775..c28e93c28 100644
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -1043,12 +1043,18 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest,
cx_data[1] = 0x01;
cx_data[2] = 0x2a;
+ /* Pack scale and frame size into 16 bits. Store it 8 bits at a time.
+ * https://tools.ietf.org/html/rfc6386
+ * 9.1. Uncompressed Data Chunk
+ * 16 bits : (2 bits Horizontal Scale << 14) | Width (14 bits)
+ * 16 bits : (2 bits Vertical Scale << 14) | Height (14 bits)
+ */
v = (pc->horiz_scale << 14) | pc->Width;
- cx_data[3] = v;
+ cx_data[3] = v & 0xFF;
cx_data[4] = v >> 8;
v = (pc->vert_scale << 14) | pc->Height;
- cx_data[5] = v;
+ cx_data[5] = v & 0xFF;
cx_data[6] = v >> 8;
extra_bytes_packed = 7;