|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfi.helsinki.cs.ohtu.mpeg2.video.IntraMacroblock
public class IntraMacroblock
A macroblock contains a section of the luminance component and the spatially corresponding chrominance components.
A 4:2:0 macroblock consists of 6 blocks. (YYYYCbCr)
TODO: Some methods must be changed in order to get other chromaformats working: A 4:2:2 macroblock consists of 8 blocks. (YYYYCbCrCbCr) A 4:4:4 macroblock consists of 12 blocks. (YYYYCbCrCbCrCbCrCbCr)
| Field Summary | |
|---|---|
private IntraBlock[] |
blocks
|
private MacroblockHeader |
header
|
| Constructor Summary | |
|---|---|
IntraMacroblock()
Constructs a Macroblock high-level instance. |
|
| Method Summary | |
|---|---|
int |
getAddressIncrement()
Gets the address increment. |
IntraBlock |
getBlock(int blockNumber)
Gets block(0-5) from macroblock. |
IntraBlock |
getBlock(IntraBlock.ColourComponent c,
int x,
int y)
Gets block with given colour component and given position(x,y) from macroblock. |
private static int |
getBlockIndex(IntraBlock.ColourComponent c,
int x,
int y)
Calculates block's index(0-5). |
private int[] |
getMacroblockType()
Gets macroblockType. |
int |
getQuantizerScaleCode()
Gets the specified override quantizer scale code. |
boolean |
hasDCTType()
Determines if the type of DCT used is specified. |
boolean |
hasQuantizerScaleCode()
Determines if the macroblock specifies an override quantizer scale code. |
boolean |
isDCTTypeField()
Determines if the specified DCT type is field-based. |
boolean |
isDCTTypeFrame()
Determines if the specified DCT type is frame-based. |
void |
removeAllBlocks()
Removes all blocks from macroblock. |
void |
removeBlock(int blockNumber)
Removes selected block from macroblock. |
void |
removeBlock(IntraBlock.ColourComponent c,
int x,
int y)
Removes block with given colour component and given position(x,y) from macroblock. |
void |
setAddressIncrement(int addressIncrement)
Sets the address increment. |
void |
setBlock(int blockNumber,
IntraBlock block)
Add blocks to macroblock. |
void |
setBlock(IntraBlock.ColourComponent c,
int x,
int y,
IntraBlock block)
Add blocks to macroblock. |
void |
setDCTTypeField()
Sets the macroblock to specify a field-based DCT type. |
void |
setDCTTypeFrame()
Sets the macroblock to specify a frame-based DCT type. |
void |
setQuantizerScaleCode(int quantizerScaleCode)
Sets the macroblock to specify an override quantizer scale code. |
void |
unsetDCTType()
Unsets any DCT type specification previously set by setDCTTypeField() and/or setDCTTypeFrame(). |
void |
unsetQuantizerScaleCode()
Unsets any override quantizer scale code previously set by setQuantizerScaleCode(). |
void |
writeTo(BitOutputStream stream)
Writes the macroblock to a bit-by-bit output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private MacroblockHeader header
private IntraBlock[] blocks
| Constructor Detail |
|---|
public IntraMacroblock()
| Method Detail |
|---|
public void setBlock(int blockNumber,
IntraBlock block)
Add blocks to macroblock. Blocks are held in Array.
In chromaformat 4:2:0 macroblock structure is following:
0:Y
1:Y
2:Y
3:Y
4:Cb
5:Cr
blockNumber - selects where block is going to be addedblock - block to be added
public void setBlock(IntraBlock.ColourComponent c,
int x,
int y,
IntraBlock block)
Add blocks to macroblock. Blocks are held in Array.
In chromaformat 4:2:0 macroblock structure is following:
0:Y
1:Y
2:Y
3:Y
4:Cb
5:Cr
c - selects where block is going to be addedx - horizontal position of blocky - vertical position of blockblock - block to be added
public IntraBlock getBlock(IntraBlock.ColourComponent c,
int x,
int y)
c - ColourComponentx - horizontal position of blocky - vertical position of block
public void removeBlock(IntraBlock.ColourComponent c,
int x,
int y)
c - ColourComponentx - horizontal position of blocky - vertical position of blockpublic IntraBlock getBlock(int blockNumber)
blockNumber - selects block to be returned
public void removeBlock(int blockNumber)
blockNumber - selects the block to be removedpublic void removeAllBlocks()
public void setAddressIncrement(int addressIncrement)
addressIncrement - The increment to set. Must be positive.public int getAddressIncrement()
public void setQuantizerScaleCode(int quantizerScaleCode)
quantizerScaleCode - The scale code to set. Must fit into 5 bits as an unsigned integer.public int getQuantizerScaleCode()
public void unsetQuantizerScaleCode()
public boolean hasQuantizerScaleCode()
true if a scale code is specified, false if not.public boolean hasDCTType()
true if a dct type is specified, false if not.public void setDCTTypeField()
public void setDCTTypeFrame()
public void unsetDCTType()
public boolean isDCTTypeField()
true if field-based, false if frame-based.public boolean isDCTTypeFrame()
true if frame-based, false if field-based.private int[] getMacroblockType()
private static int getBlockIndex(IntraBlock.ColourComponent c,
int x,
int y)
c - ColourComponentx - horizontal position of blocky - vertical position of block
public void writeTo(BitOutputStream stream)
throws java.io.IOException
stream - the stream to write to.
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||