summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libhb/common.c16
-rw-r--r--libhb/decssasub.c4
2 files changed, 10 insertions, 10 deletions
diff --git a/libhb/common.c b/libhb/common.c
index 9c06d783b..b2581ec5e 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -1502,7 +1502,7 @@ hb_attachment_t *hb_attachment_copy(const hb_attachment_t *src)
/**********************************************************************
* hb_yuv2rgb
**********************************************************************
- * Converts a YCbCr pixel to an RGB pixel.
+ * Converts a YCrCb pixel to an RGB pixel.
*
* This conversion is lossy (due to rounding and clamping).
*
@@ -1515,12 +1515,12 @@ int hb_yuv2rgb(int yuv)
int r, g, b;
y = (yuv >> 16) & 0xff;
- Cb = (yuv >> 8) & 0xff;
- Cr = (yuv ) & 0xff;
+ Cr = (yuv >> 8) & 0xff;
+ Cb = (yuv ) & 0xff;
- r = 1.164 * (y - 16) + 2.018 * (Cb - 128);
- g = 1.164 * (y - 16) - 0.813 * (Cr - 128) - 0.391 * (Cb - 128);
- b = 1.164 * (y - 16) + 1.596 * (Cr - 128);
+ r = 1.164 * (y - 16) + 1.596 * (Cr - 128);
+ g = 1.164 * (y - 16) - 0.392 * (Cb - 128) - 0.813 * (Cr - 128);
+ b = 1.164 * (y - 16) + 2.017 * (Cb - 128);
r = (r < 0) ? 0 : r;
g = (g < 0) ? 0 : g;
@@ -1536,7 +1536,7 @@ int hb_yuv2rgb(int yuv)
/**********************************************************************
* hb_rgb2yuv
**********************************************************************
- * Converts an RGB pixel to a YCbCr pixel.
+ * Converts an RGB pixel to a YCrCb pixel.
*
* This conversion is lossy (due to rounding and clamping).
*
@@ -1564,7 +1564,7 @@ int hb_rgb2yuv(int rgb)
Cb = (Cb > 255) ? 255 : Cb;
Cr = (Cr > 255) ? 255 : Cr;
- return (y << 16) | (Cb << 8) | Cr;
+ return (y << 16) | (Cr << 8) | Cb;
}
const char * hb_subsource_name( int source )
diff --git a/libhb/decssasub.c b/libhb/decssasub.c
index 03fb495db..460a8ddc0 100644
--- a/libhb/decssasub.c
+++ b/libhb/decssasub.c
@@ -549,8 +549,8 @@ static hb_buffer_t *ssa_decode_line_to_picture( hb_work_object_t * w, uint8_t *i
int srcA = srcRgba[3];
*dstY = (srcYuv >> 16) & 0xff;
- *dstU = (srcYuv >> 8 ) & 0xff;
- *dstV = (srcYuv >> 0 ) & 0xff;
+ *dstV = (srcYuv >> 8 ) & 0xff;
+ *dstU = (srcYuv >> 0 ) & 0xff;
*dstA = srcA / 16; // HB's max alpha value is 16
}