diff options
Diffstat (limited to 'libvpx/vp8/decoder')
-rw-r--r-- | libvpx/vp8/decoder/decodemv.c | 12 | ||||
-rw-r--r-- | libvpx/vp8/decoder/decodframe.c | 17 | ||||
-rw-r--r-- | libvpx/vp8/decoder/threading.c | 13 |
3 files changed, 14 insertions, 28 deletions
diff --git a/libvpx/vp8/decoder/decodemv.c b/libvpx/vp8/decoder/decodemv.c index 8027a07..35a22c7 100644 --- a/libvpx/vp8/decoder/decodemv.c +++ b/libvpx/vp8/decoder/decodemv.c @@ -110,8 +110,8 @@ static int read_mvcomponent(vp8_reader *r, const MV_CONTEXT *mvc) static void read_mv(vp8_reader *r, MV *mv, const MV_CONTEXT *mvc) { - mv->row = (short)(read_mvcomponent(r, mvc) << 1); - mv->col = (short)(read_mvcomponent(r, ++mvc) << 1); + mv->row = (short)(read_mvcomponent(r, mvc) * 2); + mv->col = (short)(read_mvcomponent(r, ++mvc) * 2); } @@ -292,9 +292,9 @@ static void decode_split_mv(vp8_reader *const bc, MODE_INFO *mi, blockmv.as_int = 0; if( vp8_read(bc, prob[2]) ) { - blockmv.as_mv.row = read_mvcomponent(bc, &mvc[0]) << 1; + blockmv.as_mv.row = read_mvcomponent(bc, &mvc[0]) * 2; blockmv.as_mv.row += best_mv.as_mv.row; - blockmv.as_mv.col = read_mvcomponent(bc, &mvc[1]) << 1; + blockmv.as_mv.col = read_mvcomponent(bc, &mvc[1]) * 2; blockmv.as_mv.col += best_mv.as_mv.col; } } @@ -512,15 +512,15 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi) else { mbmi->mode = NEARMV; - vp8_clamp_mv2(&near_mvs[CNT_NEAR], &pbi->mb); mbmi->mv.as_int = near_mvs[CNT_NEAR].as_int; + vp8_clamp_mv2(&mbmi->mv, &pbi->mb); } } else { mbmi->mode = NEARESTMV; - vp8_clamp_mv2(&near_mvs[CNT_NEAREST], &pbi->mb); mbmi->mv.as_int = near_mvs[CNT_NEAREST].as_int; + vp8_clamp_mv2(&mbmi->mv, &pbi->mb); } } else diff --git a/libvpx/vp8/decoder/decodframe.c b/libvpx/vp8/decoder/decodframe.c index 51eeb02..16da78a 100644 --- a/libvpx/vp8/decoder/decodframe.c +++ b/libvpx/vp8/decoder/decodframe.c @@ -211,7 +211,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, (b->qcoeff[0] * DQC[0], dst, dst_stride, dst, dst_stride); - ((int *)b->qcoeff)[0] = 0; + vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0])); } } } @@ -248,21 +248,14 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, vp8_short_inv_walsh4x4(&b->dqcoeff[0], xd->qcoeff); - ((int *)b->qcoeff)[0] = 0; - ((int *)b->qcoeff)[1] = 0; - ((int *)b->qcoeff)[2] = 0; - ((int *)b->qcoeff)[3] = 0; - ((int *)b->qcoeff)[4] = 0; - ((int *)b->qcoeff)[5] = 0; - ((int *)b->qcoeff)[6] = 0; - ((int *)b->qcoeff)[7] = 0; + vpx_memset(b->qcoeff, 0, 16 * sizeof(b->qcoeff[0])); } else { b->dqcoeff[0] = b->qcoeff[0] * xd->dequant_y2[0]; vp8_short_inv_walsh4x4_1(&b->dqcoeff[0], xd->qcoeff); - ((int *)b->qcoeff)[0] = 0; + vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0])); } /* override the dc dequant constant in order to preserve the @@ -576,7 +569,7 @@ static void decode_mb_rows(VP8D_COMP *pbi) xd->left_available = 0; - xd->mb_to_top_edge = -((mb_row * 16)) << 3; + xd->mb_to_top_edge = -((mb_row * 16) << 3); xd->mb_to_bottom_edge = ((pc->mb_rows - 1 - mb_row) * 16) << 3; xd->recon_above[0] = dst_buffer[0] + recon_yoffset; @@ -1026,7 +1019,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) const unsigned char *clear = data; if (pbi->decrypt_cb) { - int n = data_end - data; + int n = (int)(data_end - data); if (n > 10) n = 10; pbi->decrypt_cb(pbi->decrypt_state, data, clear_buffer, n); clear = clear_buffer; diff --git a/libvpx/vp8/decoder/threading.c b/libvpx/vp8/decoder/threading.c index 7303189..fe290cf 100644 --- a/libvpx/vp8/decoder/threading.c +++ b/libvpx/vp8/decoder/threading.c @@ -227,7 +227,7 @@ static void mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, { vp8_dc_only_idct_add(b->qcoeff[0] * DQC[0], dst, dst_stride, dst, dst_stride); - ((int *)b->qcoeff)[0] = 0; + vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0])); } } } @@ -264,21 +264,14 @@ static void mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, vp8_short_inv_walsh4x4(&b->dqcoeff[0], xd->qcoeff); - ((int *)b->qcoeff)[0] = 0; - ((int *)b->qcoeff)[1] = 0; - ((int *)b->qcoeff)[2] = 0; - ((int *)b->qcoeff)[3] = 0; - ((int *)b->qcoeff)[4] = 0; - ((int *)b->qcoeff)[5] = 0; - ((int *)b->qcoeff)[6] = 0; - ((int *)b->qcoeff)[7] = 0; + vpx_memset(b->qcoeff, 0, 16 * sizeof(b->qcoeff[0])); } else { b->dqcoeff[0] = b->qcoeff[0] * xd->dequant_y2[0]; vp8_short_inv_walsh4x4_1(&b->dqcoeff[0], xd->qcoeff); - ((int *)b->qcoeff)[0] = 0; + vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0])); } /* override the dc dequant constant in order to preserve the |