1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-25 01:37:21 +00:00

Make C code in yuv2yuv1() do accurate rounding, this could be split

depending on SWS_ACCURATE as well if someone wants.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27323 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2008-07-18 00:09:09 +00:00
parent 3076d107cf
commit 17b0917069

View File

@ -1020,7 +1020,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr
int i;
for (i=0; i<dstW; i++)
{
int val= lumSrc[i]>>7;
int val= (lumSrc[i]+64)>>7;
if (val&256){
if (val<0) val=0;
@ -1033,8 +1033,8 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr
if (uDest)
for (i=0; i<chrDstW; i++)
{
int u=chrSrc[i]>>7;
int v=chrSrc[i + VOFW]>>7;
int u=(chrSrc[i ]+64)>>7;
int v=(chrSrc[i + VOFW]+64)>>7;
if ((u|v)&256){
if (u<0) u=0;