* Class for extracting information from a frame header.
*/
@LATTICE("HI<HNS,HNS<H,C<H,NS<FS,FS<H,FS<HV,H<SYNC,HV<SYNC,HV<T,SYNC*,HV*,FS*,HI*")
-@METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
+// @METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
+@METHODDEFAULT("THIS,THISLOC=THIS,RETURNLOC=THIS")
public final class Header {
public static final int[][] frequencies = { { 22050, 24000, 16000, 1 },
@LOC("T")
private int _headerstring = -1; // E.B
+ @LOC("T")
private SideInfoBuffer sib;
+ @LOC("T")
private BitReserve br;
Header() {
}
+ @LATTICE("OUT<BUF,BUF<THIS,THISLOC=THIS,RETURNLOC=OUT")
public String toString() {
- StringBuffer buffer = new StringBuffer(200);
+ @LOC("BUF") StringBuffer buffer = new StringBuffer(200);
buffer.append("Layer ");
buffer.append(layer_string());
buffer.append(" frame ");
buffer.append(' ');
buffer.append(bitrate_string());
- String s = buffer.toString();
+ @LOC("OUT") String s = buffer.toString();
return s;
}
boolean sync = false;
do {
headerstring = stream.syncHeader(syncmode);
- if(headerstring==-1){
+ if (headerstring == -1) {
return -1;
}
_headerstring = headerstring; // E.B
/**
* Returns version.
*/
- @RETURNLOC("OUT")
public int version() {
return h_version;
}
/**
* Returns Layer ID.
*/
- @RETURNLOC("OUT")
public int layer() {
return h_layer;
}
/**
* Returns bitrate index.
*/
- @RETURNLOC("OUT")
public int bitrate_index() {
return h_bitrate_index;
}
/**
* Returns Mode.
*/
- @RETURNLOC("OUT")
public int mode() {
return h_mode;
}
/**
* Returns Slots.
*/
- @RETURNLOC("OUT")
public int slots() {
return nSlots;
}
/**
* Returns Mode Extension.
*/
- @RETURNLOC("OUT")
public int mode_extension() {
return h_mode_extension;
}
// E.B -> private to public
- @LOC("T")
public static final int bitrates[][][] = {
{
{ 0 /* free format */, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000,
*
* @return milliseconds per frame
*/
+ @LATTICE("OUT<THIS,THISLOC=THIS,RETURNLOC=OUT")
public float ms_per_frame() // E.B
{
if (h_vbr == true) {
- double tpf = h_vbr_time_per_frame[layer()] / frequency();
+ @LOC("OUT") double tpf = h_vbr_time_per_frame[layer()] / frequency();
if ((h_version == MPEG2_LSF) || (h_version == MPEG25_LSF))
tpf /= 2;
return ((float) (tpf * 1000));
} else {
- float ms_per_frame_array[][] =
+ @LOC("OUT") float ms_per_frame_array[][] =
{ { 8.707483f, 8.0f, 12.0f }, { 26.12245f, 24.0f, 36.0f }, { 26.12245f, 24.0f, 36.0f } };
return (ms_per_frame_array[h_layer - 1][h_sample_frequency]);
}
}
// E.B -> private to public
- @LOC("T")
public static final String bitrate_str[][][] = {
{
{ "free format", "32 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s",
*
* @return number of subbands
*/
- @RETURNLOC("OUT")
public int number_of_subbands() {
return h_number_of_subbands;
}
*
* @return intensity
*/
- @RETURNLOC("OUT")
public int intensity_stereo_bound() {
return h_intensity_stereo_bound;
}