Here you can find the source of clipPlus128(int v)
private static int clipPlus128(int v)
//package com.java2s; /**/*from ww w.j a v a 2 s. c o m*/ * This class is part of JCodec ( www.jcodec.org ) This software is distributed * under FreeBSD License * * @author The JCodec project * */ public class Main { /** * Clamp, then convert signed number back to pixel value. */ private static int clipPlus128(int v) { return (int) (clipSigned(v) + 128); } private static int clipSigned(int v) { return (int) (v < -128 ? -128 : (v > 127 ? 127 : v)); } }