diff options
author | davilla <davilla@4pi.com> | 2011-09-26 18:03:29 -0400 |
---|---|---|
committer | davilla <davilla@4pi.com> | 2011-09-26 18:03:49 -0400 |
commit | 55746698d10f0ea1b4705f114bce5126cbfc2a56 (patch) | |
tree | 90b420bd4521f35e9e3e2044d54de79679250abd | |
parent | ea93187ca31708095f7ed1c8a66f177f1867b228 (diff) |
[chd] really fix the green pixel issue for crystalhd
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp index f4809b9ebe..3dad964c33 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp @@ -749,42 +749,34 @@ void CMPCOutputThread::CheckUpperLeftGreenPixelHack(CPictureBuffer *pBuffer) // driver cannot do the restore and zeros the pixel. This is wrong for // yuv color space, uv values should be set to 128 otherwise we get a // bright green pixel in upper left. - // We fix this by checking if the 1st pixel uv values are zero and if yes, - // replicating the uv values from the 2nd pixel to the 1st. + // We fix this by replicating the 2nd pixel to the 1st. switch(pBuffer->m_format) { default: case DVDVideoPicture::FMT_YUV420P: { + uint8_t *d_y = pBuffer->m_y_buffer_ptr; uint8_t *d_u = pBuffer->m_u_buffer_ptr; uint8_t *d_v = pBuffer->m_v_buffer_ptr; - if (d_u[0] == 0 && d_v[0] == 0) - { - d_u[0] = d_u[1]; - d_v[0] = d_v[1]; - } + d_y[0] = d_y[1]; + d_u[0] = d_u[1]; + d_v[0] = d_v[1]; } break; case DVDVideoPicture::FMT_NV12: { - uint8_t *d_uv = pBuffer->m_uv_buffer_ptr; - if (d_uv[0] == 0 && d_uv[1] == 0) - { - d_uv[0] = d_uv[2]; - d_uv[1] = d_uv[3]; - } + uint8_t *d_y = pBuffer->m_y_buffer_ptr; + uint16_t *d_uv = (uint16_t*)pBuffer->m_uv_buffer_ptr; + d_y[0] = d_y[1]; + d_uv[0] = d_uv[1]; } break; case DVDVideoPicture::FMT_YUY2: { - uint8_t *d_yuyv = pBuffer->m_y_buffer_ptr; - if (d_yuyv[1] == 0 && d_yuyv[3] == 0) - { - d_yuyv[1] = d_yuyv[5]; - d_yuyv[3] = d_yuyv[7]; - } + uint32_t *d_yuyv = (uint32_t*)pBuffer->m_y_buffer_ptr; + d_yuyv[0] = d_yuyv[1]; } break; } |