ref: d39b12a4db9b38cefe7c249acef87f17113eff78
parent: 2c133152f7900ac51eff616bd2cf6a8ee46dfd57
parent: 23fc1f731067c075ecb109c4faee364db8f23c2d
author: Deb Mukherjee <[email protected]>
date: Thu Oct 16 05:23:57 EDT 2014
Merge "Fix in bit-shift operation for highbitdepth decode"
--- a/tools_common.c
+++ b/tools_common.c
@@ -276,7 +276,7 @@
// Note the offset is 1 less than half.
const int offset = input_shift > 0 ? (1 << (input_shift - 1)) - 1 : 0;
int plane;
- if (dst->w != src->w || dst->h != src->h ||
+ if (dst->d_w != src->d_w || dst->d_h != src->d_h ||
dst->x_chroma_shift != src->x_chroma_shift ||
dst->y_chroma_shift != src->y_chroma_shift ||
dst->fmt != src->fmt || input_shift < 0) {
@@ -293,12 +293,12 @@
break;
}
for (plane = 0; plane < 3; plane++) {
- int w = src->w;
- int h = src->h;
+ int w = src->d_w;
+ int h = src->d_h;
int x, y;
if (plane) {
- w >>= src->x_chroma_shift;
- h >>= src->y_chroma_shift;
+ w = (w + src->x_chroma_shift) >> src->x_chroma_shift;
+ h = (h + src->y_chroma_shift) >> src->y_chroma_shift;
}
for (y = 0; y < h; y++) {
uint16_t *p_src =
@@ -316,7 +316,7 @@
// Note the offset is 1 less than half.
const int offset = input_shift > 0 ? (1 << (input_shift - 1)) - 1 : 0;
int plane;
- if (dst->w != src->w || dst->h != src->h ||
+ if (dst->d_w != src->d_w || dst->d_h != src->d_h ||
dst->x_chroma_shift != src->x_chroma_shift ||
dst->y_chroma_shift != src->y_chroma_shift ||
dst->fmt != src->fmt + VPX_IMG_FMT_HIGHBITDEPTH ||
@@ -334,8 +334,8 @@
break;
}
for (plane = 0; plane < 3; plane++) {
- int w = src->w;
- int h = src->h;
+ int w = src->d_w;
+ int h = src->d_h;
int x, y;
if (plane) {
w = (w + src->x_chroma_shift) >> src->x_chroma_shift;
@@ -384,8 +384,8 @@
int h = src->d_h;
int x, y;
if (plane) {
- w >>= src->x_chroma_shift;
- h >>= src->y_chroma_shift;
+ w = (w + src->x_chroma_shift) >> src->x_chroma_shift;
+ h = (h + src->y_chroma_shift) >> src->y_chroma_shift;
}
for (y = 0; y < h; y++) {
uint16_t *p_src =