|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoders.Encoder
coders.ProgressiveDivisibilityEncoder
public class ProgressiveDivisibilityEncoder
| Field Summary | |
|---|---|
private int |
achievedCapacity
|
private int |
adjustmentCount
|
private int |
escapeCount
|
private java.util.LinkedList<java.lang.Integer> |
integerPayload
|
private int |
n
|
private boolean |
suppressPayloadCapacityErrors
|
java.util.ArrayList<java.lang.Integer> |
tempCEmbedding
|
private int |
transformableCount
|
| Fields inherited from class coders.Encoder |
|---|
encoded, encodedBitmap, originalBitmap, payload, psnr, psnrComputed |
| Constructor Summary | |
|---|---|
ProgressiveDivisibilityEncoder(Bitmap originalBitmap,
BitSequence payload,
int n)
|
|
| Method Summary | |
|---|---|
void |
encode()
This method uses the progressive divisibility method to encode the specified payload, along with corrective information, into the bitmap. |
int |
getAchievedCapacity()
|
void |
setPayloadCapacityErrorSuppression(boolean suppress)
|
| Methods inherited from class coders.Encoder |
|---|
computePSNR, getEncodedBitmap, getOriginalBitmap, getPayload |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.util.ArrayList<java.lang.Integer> tempCEmbedding
private final int n
private java.util.LinkedList<java.lang.Integer> integerPayload
private int achievedCapacity
private int transformableCount
private int adjustmentCount
private int escapeCount
private boolean suppressPayloadCapacityErrors
| Constructor Detail |
|---|
public ProgressiveDivisibilityEncoder(Bitmap originalBitmap,
BitSequence payload,
int n)
| Method Detail |
|---|
public void encode()
In the first phase, we consider each pixel. If the pixel can be transformed (satisfies divisibility constraint and thus information can be stored within it that causes it to no longer satisfy the divisibility constraint), it is transformed, but no data is embedded. If it cannot be transformed, it is adjusted to satisfy the divisibility constraint and its corrective data is added to the list of correction values (cValues).
In the second phase, we go through every pixel in reverse order. If it had note been transformed, it is ignored. If it had been transformed, data is embedded in it. The decoder will require each pixel to be restored to its original value before it can extract information from the subsequent pixel. Thus the corrective values must be embedded first, as they will be needed to restore up-coming pixels during decoding.
Only values between 1 and n inclusive can be embedded, but values from 0 to n inclusive may need to be encoded as corrective data. We thus implement a special escape value. Whenever we want embed a (0) or (1), we will embed a (1) followed by a (1) or (2) respectively. This allows us to keep the embedded data within range. A special escaped pair (1), (n) will be embedded to indicate the end of the corrective data and the beginning of the payload data, so that the payload data is unencumbered by the escape sequence limitations.
encode in class Encoderpublic int getAchievedCapacity()
public void setPayloadCapacityErrorSuppression(boolean suppress)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||