Class VP8Frame
- java.lang.Object
-
- com.twelvemonkeys.imageio.plugins.webp.vp8.VP8Frame
-
public final class VP8Frame extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static intBLOCK_TYPESprivate static intCOEF_BANDSprivate int[][][][]coefProbsprivate MacroBlock[]currentMacroBlockRowprivate intcurrentMacroBlockRowIndexprivate booleandebugprivate intfilterLevelprivate int[][]filterLevelsprivate javax.imageio.stream.ImageInputStreamframeprivate intframeTypeprivate intheightprivate MacroBlock[]lastNonBPredMacroBlockByColumnprivate javax.imageio.event.IIOReadProgressListenerlistenerprivate intmacroBlockColsprivate intmacroBlockNoCoeffSkipprivate intmacroBlockRowsprivate MacroBlock[][]macroBlocksprivate intmacroBlockSegementAbsoluteDeltaprivate int[]macroBlockSegmentTreeProbsprivate static intMAX_ENTROPY_TOKENSprivate static intMAX_MODE_LF_DELTASprivate static intMAX_REF_LF_DELTASprivate int[]modeLoopFilterDeltasprivate intmodeRefLoopFilterDeltaEnabledprivate intmodeRefLoopFilterDeltaUpdateprivate intmultiTokenPartitionprivate longoffsetprivate static intPREV_COEF_CONTEXTSprivate MacroBlock[]previousMacroBlockRowprivate int[]refLoopFilterDeltasprivate intrefreshEntropyProbsprivate intrefreshLastFrameprivate byte[]rgbprivate intsegmentationIsEnabledprivate int[][]segmentIdsprivate SegmentQuantssegmentQuantsprivate intsharpnessLevelprivate booleansimpleFilterprivate int[][]skipCoeffsprivate BoolDecodertokenBoolDecoderprivate java.util.List<BoolDecoder>tokenBoolDecodersprivate MacroBlock[]topMacroBlockRowprivate intupdateMacroBlockSegmentationMapprivate intupdateMacroBlockSegmentatonDataprivate int[][]uvModesprivate intwidthprivate int[][]yModesprivate int[][][]ySubBlockModesprivate byte[]yuv
-
Constructor Summary
Constructors Constructor Description VP8Frame(javax.imageio.stream.ImageInputStream stream, boolean debug)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcopyBlock(MacroBlock macroBlock, java.awt.image.WritableRaster byteRGBRaster, java.awt.Rectangle region, int xSubsampling, int ySubsampling)private voidcreateMacroBlockMetadata()private MacroBlock[]createMacroBlockRow(int mbRow)booleandecode(java.awt.image.WritableRaster raster, javax.imageio.ImageReadParam param)private voiddecodeMacroBlockRow(int mbRow, java.awt.image.WritableRaster raster, java.awt.Rectangle region, int xSubsampling, int ySubsampling)private voidfireProgressUpdate(int mbRow)(package private) SubBlockgetAboveRightSubBlock(SubBlock sb, SubBlock.Plane plane)(package private) SubBlockgetAboveSubBlock(SubBlock sb, SubBlock.Plane plane)private intgetAboveYSubBlockMode(int mbRow, int mbCol, int subX, int subY)private intgetBitAsInt(int data, int bit)(package private) int[][][][]getCoefProbs()java.awt.image.BufferedImagegetDebugImageDiff()java.awt.image.BufferedImagegetDebugImagePredict()java.awt.image.BufferedImagegetDebugImageUBuffer()java.awt.image.BufferedImagegetDebugImageUDiffBuffer()java.awt.image.BufferedImagegetDebugImageUPredBuffer()java.awt.image.BufferedImagegetDebugImageVBuffer()java.awt.image.BufferedImagegetDebugImageVDiffBuffer()java.awt.image.BufferedImagegetDebugImageVPredBuffer()java.awt.image.BufferedImagegetDebugImageYBuffer()java.awt.image.BufferedImagegetDebugImageYDiffBuffer()java.awt.image.BufferedImagegetDebugImageYPredBuffer()intgetFrameType()intgetHeight()(package private) SubBlockgetLeftSubBlock(SubBlock sb, SubBlock.Plane plane)private intgetLeftYSubBlockMode(int mbRow, int mbCol, int subX, int subY)(package private) MacroBlockgetMacroBlock(int mbCol, int mbRow)intgetMacroBlockCols()java.lang.StringgetMacroBlockDebugString(int mbx, int mby, int sbx, int sby)intgetMacroBlockRows()intgetQIndex()SegmentQuantsgetSegmentQuants()intgetSharpnessLevel()BoolDecodergetTokenBoolDecoder()intgetWidth()private intgetYSubBlockMode(int mbRow, int mbCol, int subX, int subY)private voidinitializeWindowedDecodeState()private voidpopulateMacroBlock(MacroBlock macroBlock, int mbRow, int mbCol)private voidreadModes(BoolDecoder bc)private intreadPartitionSize(long l)private intreadSubBlockMode(BoolDecoder bc, int A, int L)private intreadUvMode(BoolDecoder bc)private intreadYMode(BoolDecoder bc)voidsetProgressListener(javax.imageio.event.IIOReadProgressListener listener)private voidsetupTokenDecoder(BoolDecoder bc, int first_partition_length_in_bytes, long offset)private static intySubBlockModeIndex(int subX, int subY)
-
-
-
Field Detail
-
BLOCK_TYPES
private static final int BLOCK_TYPES
- See Also:
- Constant Field Values
-
COEF_BANDS
private static final int COEF_BANDS
- See Also:
- Constant Field Values
-
MAX_ENTROPY_TOKENS
private static final int MAX_ENTROPY_TOKENS
- See Also:
- Constant Field Values
-
MAX_MODE_LF_DELTAS
private static final int MAX_MODE_LF_DELTAS
- See Also:
- Constant Field Values
-
MAX_REF_LF_DELTAS
private static final int MAX_REF_LF_DELTAS
- See Also:
- Constant Field Values
-
PREV_COEF_CONTEXTS
private static final int PREV_COEF_CONTEXTS
- See Also:
- Constant Field Values
-
listener
private javax.imageio.event.IIOReadProgressListener listener
-
coefProbs
private final int[][][][] coefProbs
-
filterLevel
private int filterLevel
-
frame
private final javax.imageio.stream.ImageInputStream frame
-
debug
private final boolean debug
-
frameType
private int frameType
-
height
private int height
-
macroBlockCols
private int macroBlockCols
-
macroBlockNoCoeffSkip
private int macroBlockNoCoeffSkip
-
macroBlockRows
private int macroBlockRows
-
macroBlocks
private MacroBlock[][] macroBlocks
-
currentMacroBlockRow
private MacroBlock[] currentMacroBlockRow
-
currentMacroBlockRowIndex
private int currentMacroBlockRowIndex
-
filterLevels
private int[][] filterLevels
-
lastNonBPredMacroBlockByColumn
private MacroBlock[] lastNonBPredMacroBlockByColumn
-
segmentIds
private int[][] segmentIds
-
skipCoeffs
private int[][] skipCoeffs
-
uvModes
private int[][] uvModes
-
ySubBlockModes
private int[][][] ySubBlockModes
-
yModes
private int[][] yModes
-
previousMacroBlockRow
private MacroBlock[] previousMacroBlockRow
-
topMacroBlockRow
private MacroBlock[] topMacroBlockRow
-
macroBlockSegementAbsoluteDelta
private int macroBlockSegementAbsoluteDelta
-
macroBlockSegmentTreeProbs
private int[] macroBlockSegmentTreeProbs
-
modeLoopFilterDeltas
private final int[] modeLoopFilterDeltas
-
modeRefLoopFilterDeltaEnabled
private int modeRefLoopFilterDeltaEnabled
-
modeRefLoopFilterDeltaUpdate
private int modeRefLoopFilterDeltaUpdate
-
multiTokenPartition
private int multiTokenPartition
-
offset
private long offset
-
refLoopFilterDeltas
private final int[] refLoopFilterDeltas
-
refreshEntropyProbs
private int refreshEntropyProbs
-
refreshLastFrame
private int refreshLastFrame
-
segmentationIsEnabled
private int segmentationIsEnabled
-
segmentQuants
private SegmentQuants segmentQuants
-
sharpnessLevel
private int sharpnessLevel
-
simpleFilter
private boolean simpleFilter
-
tokenBoolDecoder
private BoolDecoder tokenBoolDecoder
-
tokenBoolDecoders
private final java.util.List<BoolDecoder> tokenBoolDecoders
-
updateMacroBlockSegmentationMap
private int updateMacroBlockSegmentationMap
-
updateMacroBlockSegmentatonData
private int updateMacroBlockSegmentatonData
-
width
private int width
-
yuv
private final byte[] yuv
-
rgb
private final byte[] rgb
-
-
Method Detail
-
setProgressListener
public void setProgressListener(javax.imageio.event.IIOReadProgressListener listener)
-
createMacroBlockMetadata
private void createMacroBlockMetadata()
-
createMacroBlockRow
private MacroBlock[] createMacroBlockRow(int mbRow)
-
populateMacroBlock
private void populateMacroBlock(MacroBlock macroBlock, int mbRow, int mbCol)
-
initializeWindowedDecodeState
private void initializeWindowedDecodeState()
-
ySubBlockModeIndex
private static int ySubBlockModeIndex(int subX, int subY)
-
getYSubBlockMode
private int getYSubBlockMode(int mbRow, int mbCol, int subX, int subY)
-
getAboveYSubBlockMode
private int getAboveYSubBlockMode(int mbRow, int mbCol, int subX, int subY)
-
getLeftYSubBlockMode
private int getLeftYSubBlockMode(int mbRow, int mbCol, int subX, int subY)
-
decode
public boolean decode(java.awt.image.WritableRaster raster, javax.imageio.ImageReadParam param) throws java.io.IOException- Throws:
java.io.IOException
-
decodeMacroBlockRow
private void decodeMacroBlockRow(int mbRow, java.awt.image.WritableRaster raster, java.awt.Rectangle region, int xSubsampling, int ySubsampling) throws java.io.IOException- Throws:
java.io.IOException
-
fireProgressUpdate
private void fireProgressUpdate(int mbRow)
-
getAboveRightSubBlock
SubBlock getAboveRightSubBlock(SubBlock sb, SubBlock.Plane plane)
-
getAboveSubBlock
SubBlock getAboveSubBlock(SubBlock sb, SubBlock.Plane plane)
-
getBitAsInt
private int getBitAsInt(int data, int bit)
-
getCoefProbs
int[][][][] getCoefProbs()
-
getDebugImageDiff
public java.awt.image.BufferedImage getDebugImageDiff()
-
getDebugImagePredict
public java.awt.image.BufferedImage getDebugImagePredict()
-
getDebugImageUBuffer
public java.awt.image.BufferedImage getDebugImageUBuffer()
-
getDebugImageUDiffBuffer
public java.awt.image.BufferedImage getDebugImageUDiffBuffer()
-
getDebugImageUPredBuffer
public java.awt.image.BufferedImage getDebugImageUPredBuffer()
-
getDebugImageVBuffer
public java.awt.image.BufferedImage getDebugImageVBuffer()
-
getDebugImageVDiffBuffer
public java.awt.image.BufferedImage getDebugImageVDiffBuffer()
-
getDebugImageVPredBuffer
public java.awt.image.BufferedImage getDebugImageVPredBuffer()
-
getDebugImageYBuffer
public java.awt.image.BufferedImage getDebugImageYBuffer()
-
getDebugImageYDiffBuffer
public java.awt.image.BufferedImage getDebugImageYDiffBuffer()
-
getDebugImageYPredBuffer
public java.awt.image.BufferedImage getDebugImageYPredBuffer()
-
getFrameType
public int getFrameType()
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
getLeftSubBlock
SubBlock getLeftSubBlock(SubBlock sb, SubBlock.Plane plane)
-
getMacroBlock
MacroBlock getMacroBlock(int mbCol, int mbRow)
-
getMacroBlockCols
public int getMacroBlockCols()
-
getMacroBlockDebugString
public java.lang.String getMacroBlockDebugString(int mbx, int mby, int sbx, int sby)
-
getMacroBlockRows
public int getMacroBlockRows()
-
getQIndex
public int getQIndex()
-
getSegmentQuants
public SegmentQuants getSegmentQuants()
-
getSharpnessLevel
public int getSharpnessLevel()
-
getTokenBoolDecoder
public BoolDecoder getTokenBoolDecoder() throws java.io.IOException
- Throws:
java.io.IOException
-
readModes
private void readModes(BoolDecoder bc) throws java.io.IOException
- Throws:
java.io.IOException
-
readPartitionSize
private int readPartitionSize(long l) throws java.io.IOException- Throws:
java.io.IOException
-
readSubBlockMode
private int readSubBlockMode(BoolDecoder bc, int A, int L) throws java.io.IOException
- Throws:
java.io.IOException
-
readUvMode
private int readUvMode(BoolDecoder bc) throws java.io.IOException
- Throws:
java.io.IOException
-
readYMode
private int readYMode(BoolDecoder bc) throws java.io.IOException
- Throws:
java.io.IOException
-
setupTokenDecoder
private void setupTokenDecoder(BoolDecoder bc, int first_partition_length_in_bytes, long offset) throws java.io.IOException
- Throws:
java.io.IOException
-
copyBlock
private void copyBlock(MacroBlock macroBlock, java.awt.image.WritableRaster byteRGBRaster, java.awt.Rectangle region, int xSubsampling, int ySubsampling)
-
-