summaryrefslogtreecommitdiff
path: root/dvbsubtitle.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-03-02 10:51:46 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-03-02 10:51:46 +0100
commit1e3f6d6da29572426d5fd2fd922af9cc5219b285 (patch)
tree85a89f35bb78e82ed67eb481b18c2f79acf6b94b /dvbsubtitle.c
parentc8808a854b58a6370baba41a8a0de97f1d4f73fd (diff)
downloadvdr-1e3f6d6da29572426d5fd2fd922af9cc5219b285.tar.gz
vdr-1e3f6d6da29572426d5fd2fd922af9cc5219b285.tar.bz2
Replaced min(max()) calls with the new function constrain()
Diffstat (limited to 'dvbsubtitle.c')
-rw-r--r--dvbsubtitle.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/dvbsubtitle.c b/dvbsubtitle.c
index 54029e28..300cd7c5 100644
--- a/dvbsubtitle.c
+++ b/dvbsubtitle.c
@@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
*
- * $Id: dvbsubtitle.c 2.26 2012/02/25 14:47:44 kls Exp $
+ * $Id: dvbsubtitle.c 2.27 2012/03/02 10:47:25 kls Exp $
*/
@@ -969,9 +969,9 @@ tColor cDvbSubtitleConverter::yuv2rgb(int Y, int Cb, int Cr)
Epb = (Cb - 128);
Epr = (Cr - 128);
/* ITU-R 709 */
- Er = max(min(((298 * Ey + 460 * Epr) / 256), 255), 0);
- Eg = max(min(((298 * Ey - 55 * Epb - 137 * Epr) / 256), 255), 0);
- Eb = max(min(((298 * Ey + 543 * Epb ) / 256), 255), 0);
+ Er = constrain((298 * Ey + 460 * Epr) / 256, 0, 255);
+ Eg = constrain((298 * Ey - 55 * Epb - 137 * Epr) / 256, 0, 255);
+ Eb = constrain((298 * Ey + 543 * Epb ) / 256, 0, 255);
return (Er << 16) | (Eg << 8) | Eb;
}