summaryrefslogtreecommitdiffstats
path: root/libswscale/yuv2rgb.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2016-02-26 22:34:10 +0100
committerClément Bœsch <u@pkh.me>2016-02-27 11:13:26 +0100
commit1e7a37f0a07f3f2077352d43602e36024f6c9f2e (patch)
tree0b8b711a7894d547f7c0f6115c413b5cf6f1e920 /libswscale/yuv2rgb.c
parentf9987464cff3bb766107509964b97116996ad3f8 (diff)
downloadffmpeg-streaming-1e7a37f0a07f3f2077352d43602e36024f6c9f2e.zip
ffmpeg-streaming-1e7a37f0a07f3f2077352d43602e36024f6c9f2e.tar.gz
sws/yuv2rgb: clarify precision of coeff and offset for mmx code
It makes easier looking at the difference with the generic code just below.
Diffstat (limited to 'libswscale/yuv2rgb.c')
-rw-r--r--libswscale/yuv2rgb.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 9d79d79..62abb7d 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -817,12 +817,12 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
c->uOffset = 0x0400040004000400LL;
c->vOffset = 0x0400040004000400LL;
- c->yCoeff = roundToInt16(cy * 8192) * 0x0001000100010001ULL;
- c->vrCoeff = roundToInt16(crv * 8192) * 0x0001000100010001ULL;
- c->ubCoeff = roundToInt16(cbu * 8192) * 0x0001000100010001ULL;
- c->vgCoeff = roundToInt16(cgv * 8192) * 0x0001000100010001ULL;
- c->ugCoeff = roundToInt16(cgu * 8192) * 0x0001000100010001ULL;
- c->yOffset = roundToInt16(oy * 8) * 0x0001000100010001ULL;
+ c->yCoeff = roundToInt16(cy * (1 << 13)) * 0x0001000100010001ULL;
+ c->vrCoeff = roundToInt16(crv * (1 << 13)) * 0x0001000100010001ULL;
+ c->ubCoeff = roundToInt16(cbu * (1 << 13)) * 0x0001000100010001ULL;
+ c->vgCoeff = roundToInt16(cgv * (1 << 13)) * 0x0001000100010001ULL;
+ c->ugCoeff = roundToInt16(cgu * (1 << 13)) * 0x0001000100010001ULL;
+ c->yOffset = roundToInt16(oy * (1 << 3)) * 0x0001000100010001ULL;
c->yuv2rgb_y_coeff = (int16_t)roundToInt16(cy * (1 << 13));
c->yuv2rgb_y_offset = (int16_t)roundToInt16(oy * (1 << 9));
OpenPOWER on IntegriCloud