Commit fa040c22 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'fc1eda54'

* commit 'fc1eda54':
  swscale: fix sign extensions in yuv planar conversion

Conflicts:
	libswscale/rgb2rgb_template.c

See: a07e9d72
See: a3097260Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 83760570 fc1eda54
...@@ -355,9 +355,9 @@ static inline void yuvPlanartoyuy2_c(const uint8_t *ysrc, const uint8_t *usrc, ...@@ -355,9 +355,9 @@ static inline void yuvPlanartoyuy2_c(const uint8_t *ysrc, const uint8_t *usrc,
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc; const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
for (i = 0; i < chromWidth; i += 2) { for (i = 0; i < chromWidth; i += 2) {
uint64_t k = yc[0] + (uc[0] << 8) + uint64_t k = yc[0] + (uc[0] << 8) +
(yc[1] << 16) + (unsigned)(vc[0] << 24); (yc[1] << 16) + ((unsigned) vc[0] << 24);
uint64_t l = yc[2] + (uc[1] << 8) + uint64_t l = yc[2] + (uc[1] << 8) +
(yc[3] << 16) + (unsigned)(vc[1] << 24); (yc[3] << 16) + ((unsigned) vc[1] << 24);
*ldst++ = k + (l << 32); *ldst++ = k + (l << 32);
yc += 4; yc += 4;
uc += 2; uc += 2;
...@@ -419,9 +419,9 @@ static inline void yuvPlanartouyvy_c(const uint8_t *ysrc, const uint8_t *usrc, ...@@ -419,9 +419,9 @@ static inline void yuvPlanartouyvy_c(const uint8_t *ysrc, const uint8_t *usrc,
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc; const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
for (i = 0; i < chromWidth; i += 2) { for (i = 0; i < chromWidth; i += 2) {
uint64_t k = uc[0] + (yc[0] << 8) + uint64_t k = uc[0] + (yc[0] << 8) +
(vc[0] << 16) + (unsigned)(yc[1] << 24); (vc[0] << 16) + ((unsigned) yc[1] << 24);
uint64_t l = uc[1] + (yc[2] << 8) + uint64_t l = uc[1] + (yc[2] << 8) +
(vc[1] << 16) + (unsigned)(yc[3] << 24); (vc[1] << 16) + ((unsigned) yc[3] << 24);
*ldst++ = k + (l << 32); *ldst++ = k + (l << 32);
yc += 4; yc += 4;
uc += 2; uc += 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment